栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > C/C++/C#

Sonarqube扫描c++代码

C/C++/C# 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Sonarqube扫描c++代码

Sonarqube扫描c++代码

文章目录
  • Sonarqube扫描c++代码
    • 1.下载cppcheck和插件
    • 2.配置sonarqube
      • 2.1 配置相应的规则
      • 2.2 配置相应的xml文件路径
    • 3.进行配置文件
    • 4.查看结果

1.下载cppcheck和插件

插件的下载地址为:https://github.com/SonarOpenCommunity/sonar-cxx
cppcheck下载地址:http://cppcheck.net/

然后生成xml文档
我生成的xml文件:
生成的error:

2.配置sonarqube 2.1 配置相应的规则 2.2 配置相应的xml文件路径


这里的路径要和配置文件的路径保持一致。

3.进行配置文件

官网给的hello-world很有参考价值:
https://github.com/SonarOpenCommunity/sonar-cxx/tree/master/integration-tests/testdata/hello_world

sonar-project.properties

# metadata
sonar.projectKey=hello_world

# disable SCM support
sonar.scm.disabled=true

# file extensions assigned to the cxx programming language
sonar.cxx.file.suffixes=.cxx,.cpp,.cc,.c,.hxx,.hpp,.hh,.h

# comma-separated paths to directories containing source files
sonar.sources=src

# comma-separated list of directories where the plugin should search for include files
sonar.cxx.includeDirectories=src

# paths to the cppcheck report
sonar.cxx.cppcheck.reportPaths=reports/cppcheck.xml

# 需要添加上传的url!,此处没有写。
4.查看结果

扫描成功后的结果为:

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/353131.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号