问题标签 [sonarqube-4.5]

For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.

0 投票
1 回答
1161 浏览

sonarqube - sonar web ui is really slow

Running SonarQube 4.5.2 Backed by a high performance MS SQL 2012 production cluster

Rendering the dashboard for a project takes about 15-25 seconds.

I turned on full debug logging, and in the log I found these

And I cannot see any SQL statements in the log that take a unreasonably long time However, I found a lot of statements similar to this

This lead me to execute

= 16003

Which I find to be a very high number?

What is also interesting is that rendering the dashboard for a new project (about a month of analysis) takes half the time of a project that has been analysed for a couple of years now.

We have about 20-30 projects, but only a few of them are really active. I would say only about 3-4 active projects. The rest are only analysed approx 5-10 times a year, so these projects should not really accumulate snapshots.

The developers on the team are getting frustrated by the page loading time, so any help on tuning this is much appreciated!

Is there a way of cleaning the Sonar DB for all history?

Update

The dashboard contains

  • scale rating
  • technical debt
  • dir tangle inded
  • unit tests
  • integrations tests
  • complexity
  • documentation
  • lines of code
  • duplications
  • false positives
  • quality gate
  • most violated rules
  • most violated components
  • hotspots by issues
  • technical debt pyramid
  • events
  • issues
  • my unresolved issues
  • unresolved issues pr assignee
  • issues og metrics
  • history table x 2
  • clirr
  • project motion chart
  • project file bubble chart

I have created a more "focused" dashboard, containing fewer widgets. This has reduced the dashboard loading time by 50%, down to 10-11 seconds. Better, but also rather slow. The widgets for this dashboard are

  • quality gate
  • sqale ratine
  • technical debt
  • unit tests
  • integration tests
  • dir tangle index
  • complexity
  • history table
  • false positives
  • issues
  • unresolved issues per assignee
  • my unresolved issues
  • most violated rules
  • most violated components
  • technical debt

For the newer, smaller project, loading time is reduced from about 12 to 9 seconds, so I'm not seeing a doubleing of performance here.

Log can be found http://pastebin.com/zJcEH4Ex

0 投票
1 回答
1183 浏览

java - 运行 sonar-runner 时无法在 Sonarqube 中上传项目

我正在使用 Ubuntu 14.04 lts,Os 类型 32 位,SonarQube 4.5.2,Sonar-runner 2.4,java 版本“1.7.0_65”

在终端中运行 Sonar-runner 时显示以下错误:

使用sonar-runner -e

0 投票
1 回答
10030 浏览

sonarqube - SonarQube - 结合声纳方式,FindBugs,PMD 和 Checkstyle 没有重复

我正在寻找将 SonarQube 与 FindBugs、PMD 和 Checkstyle 插件结合使用的最佳实践。

  1. SonarQube 的默认质量配置文件“声纳方式”中的规则与插件的规则有何关系?它们是完全不同的规则还是 Sonar 方式包含这些插件中最重要的规则?
  2. 组合这些规则集的最佳方式是什么?如何避免重复检查?
  3. Sonar v.3.x 包含一个“Sonar way with Findbugs”配置文件。我在 v.4.5.1 中找不到它 - 它发生了什么事?
0 投票
2 回答
4721 浏览

ldap - 如何使用 LDAP 在 SonarQube 中添加用户

您好,我已将 LDAP 插件添加到我的新版 SonarQube (4.5.2) 中,但在向其添加用户时遇到了困难。

我检查了日志,它似乎连接了 SonarQube 并检查它,但我很难找到如何将用户从 LDAP 添加到 SonarQube。

0 投票
1 回答
377 浏览

ant - Sonarque 不执行自定义质量配置文件

我正在运行 Sonar 4.5,Jenkins 确实执行了一个包含 org.sonar.ant.SonarTask 的 ANT 任务,最初使用内置的 Sonar 规则质量配置文件“声纳方式”,一切运行良好。在介绍了我公司的自定义质量配置文件后,有“ 322k行代码中的0个问题”。当然,我从代码中知道这不是真的。

ant 任务的输出看起来没问题。声纳日志文件不会发出任何错误/警告。通过管理站点导入质量配置文件没有引发任何错误/警告,并且新规则也在管理站点上可见。

欢迎任何关于如何进行的想法。

0 投票
1 回答
683 浏览

android - Android 在 Html 或仪表板中显示 sonar-report.json

我正在尝试将声纳集成到我的应用程序中,在此之前,我试图查看在我在 Github 上找到的测试项目上运行它的分析。我能够成功地运行分析./gradlew sonarRunner

我看到它/sonar-report.json正在生成。如何在我的仪表板中查看此报告?

我试图运行分析的项目可以在这个链接上找到:

0 投票
2 回答
3154 浏览

sonarqube - SonarQube:更改弹性搜索客户端主机

简而言之:有没有办法在SonarQube 使用的弹性搜索客户端中更改目标地址?

更多信息:我很想在 OpenShift 上使用 SonarQube > 4.1。不幸的是,您无法在该环境中绑定到 localhost。所以这些家伙服务包装器更改为管道模式,并使用该sonar.web.host属性来设置 SonarQube 4.0。从SonarQube 4.1开始,我们还将拥有尝试绑定到 localhost 的弹性搜索服务器,这会导致启动时崩溃。但是没有sonar.search.host属性这样的东西(类似于sonar.search.port),是吗?

sonar.search.javaAdditionalOpts作为一种解决方法,可以使用和es.network.host参数更改服务器的绑定。是的,我知道,我不应该这样做。因为现在应用程序崩溃了。这就是为什么我正在寻找一种方法来改变这一点。 查看SonarQubes 源代码NoNodeAvailableException: No node available
,我假设客户端的目标地址是硬编码的。(虽然我可能弄错了)

我认为如果没有解决方案,我们永远不会在 OpenShift 或任何其他具有严格安全策略的环境上运行 SonarQube 5.0。

谁能想到另一种解决方法?
也许改变 Java 对“localhost”/loopback 接口的定义?然而,改变/etc/hosts如果没有 root 访问权限,更改将不起作用。还有其他想法吗?

编辑:如果你想看看自己这里是我到目前为止走了多远构建文件是必不可少的部分。

0 投票
1 回答
1826 浏览

sonarqube-4.5 - Sonar 4.5.2 插件和 java 1.7

对于声纳 4.5.2,我已将声纳插件升级到与 4.2.x http://docs.sonarqube.org/display/SONAR/Plugin+version+matrix兼容的版本,但是升级后:

1-我找不到要添加到仪表板的小部件“Most Violated Resources”,你有同样的问题吗?

2-你知道哪个小部件属于哪个插件吗?

3- Java 1.7 需要 2 个插件: Findbugs 和 cpp 。我的项目失败并显示错误消息“Java 1.6.0_85 不支持该插件”,因为我的项目使用 1.6.0_85。你遇到这个问题吗?什么是解决方法,即降级插件版本?我怎么知道我应该将它降级到哪个插件版本?

非常感谢,/哈

0 投票
2 回答
165 浏览

sonarqube - 为什么我在 SonarQube 中的新用户是使用 active=NULL 创建的?

我刚刚安装了 SonarQube 4.5,连接到 Postgres 数据库。

就代码分析而言,一切似乎都运行良好,但是当我通过设置屏幕或注册表单创建新用户时,会在数据库中将“活动”设置为 null 来创建用户。如果我手动将“活动”更新为true,我可以使用新用户,一切看起来都很好。

“用户”上的“活动”列默认设置为真。

还有其他使用相同数据库的 SonarQube 实例,每个实例都有自己的模式。正因为如此,我在安装时遇到了一些初始困难,并且不得不手动进行数据库迁移的某些部分,所以我假设我错过了一些东西,但我对 Rails 一无所知,所以我很难调试。

我不确定这是否相关,但这是我运行 SonarQube 所经历的过程:

在它的引导过程的早期,Rails 显然能够从其他模式之一中找到一个“schema_migrations”表,但是当它试图从“schema_migrations”中选择时(在正确的模式中)它找不到它,所以抛出异常并且数据库设置中止。因此,我在我的模式中创建了一个“schema_migrations”表,其中有一列“版本”,重新启动了 Sonar,它现在处于认为它正在执行版本升级并开始数据库迁移的状态。

'011_create_administrator.rb'中的迁移失败,因为它试图将 NULL 插入'users'的'active'列,而该列尚未创建。因此,我手动运行了没有“活动”部分的插入,将“schema_migrations.version”更新为 11,然后重新启动。

迁移再次开始,现在在“530_merge_measure_data_into_project_measures.rb”中失败了

因此,我将'measure_data'列添加到'project_measures',然后重新启动。现在迁移成功完成,SonarQube 正常启动,我能够以管理员身份登录并开始分析代码。

0 投票
2 回答
1333 浏览

sonarqube - sonarqube 增量分析不适用于团队配置

我已经在本地机器上配置了 sonarqube 服务器以运行,并且我使用分析模式提交了初始项目。此外,我为开发人员创建了一个 ant 目标,以增量模式运行以查看他们的新问题。我在声纳服务器上安装了问题报告,并从 ant 文件中使用它来生成 html 文件。

但是,当每个开发人员与 svn 同步并运行 ant 目标时,他们会看到其他开发人员在新问题下的违规行为,而不仅仅是他们的问题。

我希望 sonarqube 插件只扫描开发人员新编辑的文件,而是显示其他开发人员引入的所有新文件。

为了使其正常工作,我必须从我的机器上运行分析模式。然而,这只为我解决了这个问题,我的同事仍然认为所有违规行为都是新的。

SonarQube 如何确定问题是否是新问题?如果每个开发人员每次都必须进行全面分析,这将是一笔巨大的开销。有什么我想念的吗?

提前感谢您的时间和帮助。