Report is not showing in Sonarqube

Hi Everyone,

I am using Sonarscanner to analyse my C/C++ Project. I am running Sonarqube in my local server and I am able to get success result after using sonarscanner for scanning the project. But I am not able to see the report in the local server.
Please help me out if I missed anything here to confgure in my project.

C:\VDE\Projects\V210_9C_Mada_Engage_backup>sonar-scanner
INFO: Scanner configuration file: D:\Sonarqube Files\sonar-scanner-4.6.2.2472\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\VDE\Projects\V210_9C_Mada_Engage_backup\sonar-project.properties
INFO: SonarScanner 4.6.2.2472
INFO: Java 11.0.11 AdoptOpenJDK (64-bit)
INFO: Windows 10 10.0 amd64
INFO: User cache: C:\Users\Naveen\.sonar\cache
INFO: Scanner configuration file: D:\Sonarqube Files\sonar-scanner-4.6.2.2472\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: C:\VDE\Projects\V210_9C_Mada_Engage_backup\sonar-project.properties
INFO: Analyzing on SonarQube server 8.9.7
INFO: Default locale: "en_IN", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=166ms
INFO: Server id: BF41A1F2-AX7kxhom0EphMsCn2Oqp
INFO: User cache: C:\Users\Naveen\.sonar\cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=132ms
INFO: Load/download plugins (done) | time=213ms
INFO: Process project properties
INFO: Process project properties (done) | time=7ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=2ms
INFO: Project key: mada_Engage_Platform
INFO: Base dir: C:\VDE\Projects\V210_9C_Mada_Engage_backup
INFO: Working dir: C:\VDE\Projects\V210_9C_Mada_Engage_backup\.scannerwork
INFO: Load project settings for component key: 'mada_Engage_Platform'
INFO: Load project settings for component key: 'mada_Engage_Platform' (done) | time=113ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=151ms
INFO: Load active rules
INFO: Load active rules (done) | time=3829ms
INFO: Indexing files...
INFO: Project configuration:
INFO: 102 files indexed
INFO: ------------- Run sensors on module mada_Engage_Platform
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=132ms
INFO: Sonargraph Integration: Created 55 predefined and 0 custom metric(s)
INFO: Sensor CSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [cssfamily] (done) | time=2ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=1ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=2ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=2ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=3ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=1ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=2ms
INFO: Sensor Cloudformation Check [cloudformation]
INFO: Process iac reports
WARN: Missing property:sonar.cfn.nag.reportFiles
WARN: Missing property:sonar.checkov.reportFiles
INFO: Process iac reports (done) | time=2ms
INFO: Sensor Cloudformation Check [cloudformation] (done) | time=3ms
INFO: Sensor JQA [jqassistant]
INFO: No jQAssistant report found, skipping.
INFO: Sensor JQA [jqassistant] (done) | time=1ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: 'sonar.coverage.jacoco.xmlReportPaths' is not defined. Using default locations: target/site/jacoco/jacoco.xml,target/site/jacoco-it/jacoco.xml,build/reports/jacoco/test/jacocoTestReport.xml
INFO: No report imported, no coverage information will be imported by JaCoCo XML Report Importer
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=5ms
INFO: ------------- Run sensors on project
INFO: Sensor Sonargraph Integration [sonargraphintegration]
INFO: Sonargraph Integration: Loaded standard rules file '/com/hello2morrow/sonargraph/integration/sonarqube/SonargraphRules.properties'
INFO: Sonargraph Integration: No custom rules file found at 'C:\Users\Naveen/.sonargraphintegration/SonargraphRules.properties'
INFO: Sonargraph Integration: Processing SonarQube project 'mada_Engage_Platform'
INFO: Determine report path from scanner app ScannerCLI
INFO: Sonargraph Integration: XML report file path not configured - using default 'target/sonargraph/sonargraph-sonarqube-report.xml'
WARN: Sonargraph Integration: XML report file 'C:\VDE\Projects\V210_9C_Mada_Engage_backup\target\sonargraph\sonargraph-sonarqube-report.xml' not found
INFO: Sensor Sonargraph Integration [sonargraphintegration] (done) | time=13ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=5ms
INFO: CPD Executor Calculating CPD for 0 files
INFO: CPD Executor CPD calculation finished (done) | time=0ms
INFO: Analysis report generated in 66ms, dir size=138 KB
INFO: Analysis report compressed in 12ms, zip size=18 KB
INFO: Analysis report uploaded in 131ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard?id=mada_Engage_Platform
INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
INFO: More about the report processing at http://localhost:9000/api/ce/task?id=AX8GkaDpIJ_MlB9YlYSB
INFO: Executing post-job 'Final report'
INFO: Turn debug info on to get more details (sonar-scanner -X -Dsonar.verbose=true ...).
INFO: Analysis total time: 5.880 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 7.352s
INFO: Final Memory: 7M/37M
INFO: ------------------------------------------------------------------------

Hi,

Welcome to the community!

Are you using a commercial version of SonarQube? When you click through on the project name, is there a dropdown arrow on the project homepage next to the project name?

 
Ann

Hi Ann,

Sorry for late reply.
I am using community edition of Sonarqube and I cannot see any dropdown next to project name.
I want to know whether we need to use Build Wrapper for C++ Analysis? I tried searching in many sites but could not find it.
Please let me know how we can see the reports in Sonarqube for C/C++ projects.

Hi,

You’re not going to be able to analyze C/C++ in Community Edition; that’s only available starting in Developer Edition($). And that explains why you’re seeing empty projects; none of the code in them was analyzed.

Once you upgrade to Developer Edition, yes you will need to use the Build Wrapper for analysis.

 
HTH,
Ann

Hi Ann,

Thanks for your quick reply.

I could not find the build wrapper, please help me where I can find build wrapper.

Hi,

Once you’ve upgraded to Developer Edition($), you’ll be able to download the build wrapper directly from your SonarQube instance. But this is not available with Community Edition.

 
Ann

Hi Ann,

Yes after upgrading to developer edition I am able to download the build wrapper. When I run the sonnar scanner I am getting below error.


I have gone through few community queries and understood that we need to run the build wrapper before running clean build command. But I am running Build.bat file provided by our project client and this Build.bat file we are not running in usual command prompt rather we are running in the special client SHELL window.
So please suggest in this case how I can successfuly run the build wrapper.

Hi,

Can you provide the full analysis log including the full error stacktrace? In text (rather than screenshot) format? Also, are you still on SonarQube 8.9.7, or have you upgraded beyond that along with your edition upgrade?

 
Ann

Hi Ann,

Please find the full analysis report attached as text file.
Analysis_Report.txt (53.1 KB)

Yes I am using Sonarqube 8.9.7 developer edition.

Hi,

This seems to be an analysis log from a different project than the log in your OP. The problem in this latter log is pretty clear:

Error during SonarScanner execution java.lang.IllegalStateException: java.nio.file.NoSuchFileException: C:\VDE\Projects\V210_9C_Mada_Engage\bw-outputs\build-wrapper-dump.json

To analyze C/C++, you need to use the build wrapper. The docs should help.

 
Ann

Hi again,

Sorry, I just revisited earlier posts in the thread & saw that you’re aware that you need to run the build wrapper. So… what did you try?

Also, you’ve mentioned that you’ve got a custom .bat file. What compiler does it invoke?

 
Ann