简体   繁体   English

关于为什么C ++(社区)插件无法通过声纳运行器生成LOC的任何建议?

[英]Any suggestions on why the C++(community) plugin doesn't generate LOCs with the sonar-runner?

When I run sonar-runner on a C++ project, it does not generate Lines of code count. 当我在C ++项目上运行sonar-runner时,它不会生成代码行数。

I'm using the Sonar C++ Community Plugin http://docs.codehaus.org/pages/viewpage.action?pageId=185073817 我正在使用Sonar C ++社区插件http://docs.codehaus.org/pages/viewpage.action?pageId=185073817

I'm not running any preprocessing prior to running the sonar-runner. 在运行声纳运行器之前,我没有运行任何预处理。

Do I need to run any preprocessing on the C++ code prior to run the sonar-runner? 在运行声纳运行器之前,是否需要对C ++代码运行任何预处理?

I'm using: 我正在使用:

Sonar: 3.5 Sonar-runner: 2.0 C++ Plugin: sonar-cxx-plugin-0.2.jar 声纳:3.5声纳运行器:2.0 C ++插件:sonar-cxx-plugin-0.2.jar

sonar-project.properties: sonar-project.properties:

# required metadata
sonar.projectKey=external:CS
sonar.projectName=CS3D
sonar.projectVersion=2.0.0
# optional description
sonar.projectDescription=Crystal Space 3D.

# path to source directories (required)
sonar.sources=plugins,libs,apps,mk
# path to test source directories (optional)
sonar.tests=engine/test

Unless you tell it otherwise Sonar goes ahead and assumes the project is a java project. 除非您另有说明,否则Sonar会继续进行,并假定该项目是Java项目。 For other languages you need to let it know... 对于其他语言,您需要让它知道...

So a starting point would be to add the following line: 因此,起点是添加以下行:

sonar.language=c++

It should report the a lines of code count without any preprocessing. 它应该报告没有任何预处理的代码行数。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM