1

我正在尝试使用声纳检查 .cpp 代码,但我遇到了问题。

声纳版本:3.5.1 // MySQL 5.0.67

我的声纳上安装了这个插件。

Sonar C++ Community Plugin [cxx] 版本:0.2 C++ Plugin for Sonar(社区版)许可证:GNU LGPL v3

13:15:52.240 INFO  -   **/package-info.java
13:15:52.257 DEBUG - Release semaphore on project : org.sonar.api.resources.Project@eb7c20[id=415,key=glitewms,qualifier=TRK], with key batch-glitewms
13:15:52.300 DEBUG - To prevent a memory leak, the JDBC Driver [com.mysql.jdbc.Driver] has been forcibly deregistered
13:15:52.302 DEBUG - Delete temporary directory: /tmp/sonar-batch53431674173176591171032930116386070
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
Total time: 4.852s
Final Memory: 7M/22M
INFO: ------------------------------------------------------------------------

ERROR: Error during Sonar runner execution
org.sonar.runner.impl.RunnerException: Unable to execute Sonar
        at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:79)
        at org.sonar.runner.impl.BatchLauncher$1.run(BatchLauncher.java:63)
        at java.security.AccessController.doPrivileged(Native Method)
        at org.sonar.runner.impl.BatchLauncher.doExecute(BatchLauncher.java:57)
        at org.sonar.runner.impl.BatchLauncher.execute(BatchLauncher.java:50)
        at org.sonar.runner.api.EmbeddedRunner.doExecute(EmbeddedRunner.java:71)
        at org.sonar.runner.api.Runner.execute(Runner.java:89)
        at org.sonar.runner.Main.executeTask(Main.java:70)
        at org.sonar.runner.Main.execute(Main.java:59)
        at org.sonar.runner.Main.main(Main.java:41)
Caused by: org.sonar.api.utils.SonarException: **Language with key 'cpp' not found
        at** org.sonar.batch.phases.ProjectInitializer.initLanguage(ProjectInitializer.java:50)
        at org.sonar.batch.phases.ProjectInitializer.execute(ProjectInitializer.java:44)
        at org.sonar.batch.phases.Phases.execute(Phases.java:93)
        at org.sonar.batch.scan.ScanContainer.doStart(ScanContainer.java:147)
        at org.sonar.batch.bootstrap.Container.start(Container.java:72)
        at org.sonar.batch.scan.ScanTask.scan(ScanTask.java:65)
        at org.sonar.batch.scan.ScanTask.scanRecursively(ScanTask.java:56)
        at org.sonar.batch.scan.ScanTask.execute(ScanTask.java:49)
        at org.sonar.batch.bootstrap.TaskContainer.doStart(TaskContainer.java:188)
        at org.sonar.batch.bootstrap.Container.start(Container.java:72)
        at org.sonar.batch.bootstrap.TaskBootstrapContainer.executeTask(TaskBootstrapContainer.java:73)
        at org.sonar.batch.bootstrap.TaskBootstrapContainer.doStart(TaskBootstrapContainer.java:62)
        at org.sonar.batch.bootstrap.Container.start(Container.java:72)
        at org.sonar.batch.bootstrap.BootstrapContainer.doStart(BootstrapContainer.java:104)
        at org.sonar.batch.bootstrap.Container.start(Container.java:72)
        at org.sonar.batch.bootstrapper.Batch.startBatch(Batch.java:88)
        at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:72)
        at org.sonar.runner.batch.IsolatedLauncher.execute(IsolatedLauncher.java:45)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
        at java.lang.reflect.Method.invoke(Unknown Source)
        at org.sonar.runner.impl.BatchLauncher$1.delegateExecution(BatchLauncher.java:75)
        ... 9 more

在项目的属性文件中我把它: sonar.language=cpp

如果我更改 cpp,并尝试使用 c++ 或 C,运行程序执行正常,但报告不正确。

是否有解决此问题的建议或其他替代方法?

4

2 回答 2

0

我认为 C++ (Community) 插件的语言是这里定义的 c++ http://docs.codehaus.org/display/SONAR/Running+the+analysis和 c 或 cpp 是 C/C++ (SonarSource) 插件.

于 2013-09-06T18:54:39.397 回答
0

当您使用 Sonar C++ Community 插件时,语言不是 cpp 而是 cxx,请参阅http://docs.codehaus.org/pages/viewpage.action?pageId=185073817

于 2013-05-30T21:08:54.560 回答