Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  • Basic size metrics:
    • Files (number of)
    • Lines
    • Lines of comments
    • Lines of code
    • Lines of commented out code
  • Static code checking via virtually any static analyser tool. And possibility of extension of their coding rules.
  • Dynamic checking for memory management problems via Valgrind
  • Cyclomatic (McCabe) complexity metrics including: 
    • Projects complexity
    • Average function/method complexity
    • Average file complexity
    • Complexity distributions
  • Code coverage metrics including:
    • Line coverage
    • Branch coverage
    • IT line coverage
    • Overall branch coverageUnit test overage (line and branch)
    • Integration test coverage (line and branch)
    • Overall branch coverage (line and branch)
  • Unit test execution metrics including:
    • Successfully executed tests
    • Failed tests
    • Skipped tests
    • Execution time
  • Recognition of code duplication
  • Basic highlighting mode for C++ in Sonar UI

...

Property

Scope

Default

Example

Description

sonar.cxx.suffixes.sourcesSystem- and/or project-widecxx,cpp,cc,c.C,.h

Comma separated list of file name extension to be considered as C++ source files during analysis.

sonar.cxx.suffixes.headersSystem- and/or project-widehxx,hpp,hh,h Comma separated list of file name extension to be considered as C++ source files during analysis.
sonar.cxx.cppcheck.reportPathProject-widecppcheck-reports/cppcheck-result-*.xmlcppcheck-report-*.xml

Ant pattern describing the path to Cppcheck reports, relative to projects root.

sonar.cxx.cppncss.reportPathProject-widecppncss-reports/cppncss-result-*.xmlcppncss-report-*.xmlAnt pattern describing the path to CppNcss reports, relative to projects root.
sonar.cxx.gcovr.reportPath (<0.2)Project-widegcovr-reports/gcovr-result-*.xmlgcovr-report-*.xmlAnt pattern describing the path to gcovr reports, relative to projects root.
sonar.cxx.rats.reportPathProject-widerats-reports/rats-result-*.xmlrats-report-*.xmlAnt pattern describing the path to RATS reports, relative to projects root.
sonar.cxx.valgrind.reportPathProject-widevalgrind-reports/valgrind-result-*.xmlvalgrind-report-*.xmlAnt pattern describing the path to Valgrind reports, relative to projects root.
sonar.cxx.vera.reportPathProject-widevera++-reports/vera++-result-*.xmlvera-report-*.xmlAnt pattern describing the path to Vera++ reports, relative to projects root.
sonar.cxx.xunit.reportPathProject-widexunit-reports/xunit-result-*.xmlxunit-report-*.xmlAnt pattern describing the path to unit test execution reports, relative to projects root.
sonar.cxx.pclint.reportPathProject-widepclint-reports/pclint-result-*.xmlpclint-result-*.xmlAnt pattern describing the path to pc-lint reports, relative to projects root.
sonar.cxx.externalrules.reportPathProject-wideexternalrules-result/externalrules-result-*.xmlexternalrules-result-*.xmlAnt pattern describing the path to unit test execution reports, relative to projects root.
sonar.cxx.xunit.xsltURLProject-wide cppunit-1.x-to-junit-1.0.xsl

A name of a built in XSLT-file or an URL to an external one. Available builtins:

  • boosttest-1.x-to-junit-1.0.xsl         For transforming Boost-reports
  • cpptestunit-1.x-to-junit-1.0.xsl      Fortransforming CppTestUnit-reports
  • cppunit-1.x-to-junit-1.0.xsl            For transforming CppUnit-reports
sonar.cxx.coverage.reportPath (>=0.2)Project-widecoverage-reports/coverage-*.xmlcoverage-*.xmlAnt pattern describing the path of unit test coverage reports, relative to projects root.
sonar.cxx.coverage.itReportPath (>=0.2)Project-widecoverage-reports/it-coverage-*.xmlit-coverage-*.xmlAnt pattern describing the path of integration test coverage reports, relative to projects root.
sonar.cxx.coverage.overallReportPath (>=0.2)Project-widecoverage-reports/overall-coverage-*.xmloverall-coverage-*.xmlAnt pattern describing the path of overall test coverage reports, relative to projects root.

 Note: Report paths are always relative to projects path.

...

Known limitations

  • Some analyzers (RATS, most notably) may have issues and crash occasionally.
  • Valgrind is only available on a subset of UNIX platforms.

...

Following items are in the queue (more or less...):

  •  Use SSLR technology
  • Integrate compiler warnings
  • Implement the dependency analysis (package tangle index metric)

...

JIRA Issues
anonymoustrue
titleVersion 0.2
columnstype;key;summary;priority;status
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+SONARPLUGINS+AND+fixVersion+%3D+%22CXX-0.2%22&tempMax=1000

JIRA Issues
anonymoustrue
titleVersion 0.1
columnstype;key;summary;priority;status
urlhttp://jira.codehaus.org/sr/jira.issueviews:searchrequest-xml/temp/SearchRequest.xml?jqlQuery=project+%3D+SONARPLUGINS+AND+fixVersion+%3D+%22CXX-0.1%22&tempMax=1000