c++ - 我可以在哪里获得在 Linux 上对 C++ 代码运行 Sonar 库代码分析的步骤

标签 c++ linux sonarqube

下面是我运行 Sonar 运行程序时的日志:

[OMC3_B12_LINUX6] sonar@omclinux03> ./sonar-runner SonarQube Runner 2.4 Java 1.6.0_22 Sun Microsystems Inc. (64-bit) Linux 2.6.32-220.el6.x86_64 amd64 INFO: Runner configuration file: /home/sonar/sonar/sonar-runner-2.4/conf/sonar-r unner.properties INFO: Project configuration file: NONE INFO: Default locale: "en_US", source code encoding: "UTF-8" INFO: Work directory: /home/sonar/sonar/sonar-runner-2.4/bin/./.sonar ERROR: Sonar server 'http://localhost:9000' can not be reached INFO: ------------------------------------------------------------------------ INFO: EXECUTION FAILURE INFO: ------------------------------------------------------------------------ Total time: 0.065s Final Memory: 5M/964M INFO: ------------------------------------------------------------------------ ERROR: Error during Sonar runner execution ERROR: java.net.ConnectException: Connection refused ERROR: Caused by: Connection refused ERROR: ERROR: To see the full stack trace of the errors, re-run SonarQube Runner with t he -e switch. ERROR: Re-run SonarQube Runner using the -X switch to enable full debug logging.

最佳答案

日志显示sonnar-runner找不到在当前计算机上运行并监听端口9000的SonarQube实例:

ERROR: Sonar server 'http://localhost:9000' can not be reached

Sonnar-runner 需要 SonarQube 实例来运行分析。请参阅“两分钟入门”的前 4 个步骤 here

SonarQube 中的 C++ 支持是由商业插件提供的,因此您应该首先阅读 its documentation 。我认为还有一个社区插件。

对于 SonarQube 的安装,无论是哪个平台,请参阅 documentation以及上面的入门链接。

关于c++ - 我可以在哪里获得在 Linux 上对 C++ 代码运行 Sonar 库代码分析的步骤,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32086933/

相关文章:

c++ - C++ 标准中最令人惊讶的元素是什么?

linux - 使用 systemd 登录后启动 autofs

java - 可能会抛出 NullPointerException,因为 'value' 此处可为空 Sonar 警告

c# - 如何解读 SonarQube 的成果

javascript - 如何访问 SonarQube 自定义规则中的后代节点?

c++ - 寻找路径的算法

c++ - 为什么我的 OpenGL 3.3 应用程序不绘制任何东西?

c++ - OpenCV : calcOpticalFlowSF function

c++ - 构建 32 位和 64 位应用程序的 Linux 环境 (C++)

linux - udev 规则不适用于 ThinkPad X200 dock