1

I want to show a clang-tidy parsing report in SonarQube (Community Edition) using the "C ++ (Community)" plugin. But there is no output after loading. From sonarcub I need to display clang-tidy reports and no analysis is needed.

file sonar-project.properties:

sonar.projectKey=myProject
sonar.cxx.clangtidy.reportPath=clang-tidy-report
sonar.cxx.errorRecoveryEnabled=True
sonar.verbose=true 
sonar.cxx.jsonCompilationDatabase=compile_commands.json
#----- Default SonarQube server
sonar.host.url=http://localhost:9000/

I used in bash:

The build wrapper:

    build-wrapper --out-dir bw-outputs ./build.sh

And using the SonarQube Scanner:

    sonar-scanner

I found this site that shows how to work with analyzers: https://www.spazioit.com/SAFeToolsetHelp/Step4-ConfigureSonarQubeAnalyses.html

Console output:

   12:26:26.972 INFO: Analysis report uploaded in 112ms
   12:26:26.981 DEBUG: Report metadata written to 
   /home/bivk/bivk_merge/bivk_bootloader/.scannerwork/report-task.txt
   12:26:26.981 INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=bootloder
   12:26:26.981 INFO: Note that you will be able to access the updated dashboard once the server has 
   processed the submitted analysis report
   12:26:26.981 INFO: More about the report processing at http://localhost:9000/api/ce/task? 
   id=AXkiurWiHwwwwqfrQgb
   12:26:26.992 DEBUG: Post-jobs : Final report
   12:26:26.992 INFO: Executing post-job 'Final report'
   12:26:26.992 WARN: Preprocessor: 4 include directive error(s). This is only relevant if parser 
   creates 
   syntax errors. The preprocessor searches for include files in the with 
  'sonar.cxx.includeDirectories' 
   defined directories and order.
   12:26:26.992 WARN: Source code parser: 2 syntax error(s) detected. Syntax errors could cause 
   invalid 
   software metric values. Root cause are typically missing includes, missing macros or compiler 
   specific 
   extensions.
   12:26:26.998 INFO: Analysis total time: 35.382 s
   12:26:27.002 INFO: ------------------------------------------------------------------------
   12:26:27.003 INFO: EXECUTION SUCCESS
Robert Harvey
  • 178,213
  • 47
  • 333
  • 501

0 Answers0