0

我已经在 Eclipse 中安装了 SonarLint 3.2.0 插件(版本:Neon.3 (4.6.3))。我有 Java 版本 8。我有 Eclipse CDT(C++)。我写了一个示例 C++ 程序。从 SonarLint 我已经绑定我的示例 C++ 项目到远程服务器中的 SonarQube 项目。现在我已经在 SonarLint 中完成了分析,但在“SonarLint 报告”中没有显示任何内容(0 项)。我在 SonarLint 控制台中看到了以下详细信息。从详细信息中我猜可能是 sonarlint 无法识别我的 C++ 项目。

Trigger: MANUAL
SonarLint analysis of file /hello2/src/hello2.cpp...
Wrote build info to: C:\Users\workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\hello2\org.sonarlint.eclipse.core\sonarlint2463420270089611160\build-wrapper-dump.json
Connected mode (using configuration of 'TEST1' in server 'xxxx.xxxx.xxxx.xxxx')
Starting analysis with configuration:
[
  moduleKey: TEST1
  baseDir: C:\Users\workspace\hello2
  workDir: C:\Users\workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\hello2\org.sonarlint.eclipse.core
  extraProperties: {sonar.cfamily.useCache=false, sonar.cfamily.build-wrapper-output=C:\Users\workspace\.metadata\.plugins\org.eclipse.core.resources\.projects\hello2\org.sonarlint.eclipse.core\sonarlint2463420270089611160}
  inputFiles: [
    C:\Users\workspace\hello2\src\hello2.cpp
  ]
]

Available languages:
  * JavaScript => "js"
  * Java => "java"
Start analysis
Declared extensions of language JavaScript were converted to js: file:**/*.js,file:**/*.jsx,file:**/*.vue
Declared extensions of language Java were converted to java: file:**/*.java,file:**/*.jav
Quality profiles:
  * java: java-sonar-way-32683 (251 rules)
  * js: js-sonar-way-79496 (86 rules)
Index files
Language of file 'C:\Users\workspace\hello2\src\hello2.cpp' is set to 'cpp'
Setting filesystem encoding: UTF-8
1 files indexed
'JavaScript Squid Sensor' skipped because there is no related file in current project
'JavaSquidSensor' skipped because there is no related file in current project
Execute Sensor: SonarJavaXmlFileSensor
Found 0 issue(s)
Done in 32 ms

我的 Eclipse /SonarLint 或 SonarQube Server 的项目是否有任何配置问题?

当我在我的 Eclipse 中创建了一个示例 java 项目并且在没有绑定 SonarQube 远程服务器的情况下完成了分析时,我在 SonarLint 报告中报告了以下问题。

Resource    Date    Description
Hello_java.java    null    Complete the task associated to this TODO comment.
Hello_java.java    null    Rename this class name to match the regular expression '^[A-Z][a-zA-Z0-9]*$'.
Hello_java.java    null    Rename this package name to match the regular expression '^[a-z]+(\.[a-z][a-z0-9]*)*$'.
Hello_java.java    null    Replace this use of System.out or System.err by a logger.

但是对于 C++ 程序,SonarLint 无法正常工作。我是否缺少 SonarLint/Sonarqube 项目中的任何设置/配置?

4

0 回答 0