sonar-cxx icon indicating copy to clipboard operation
sonar-cxx copied to clipboard

scan of the cpp code is not happening

Open thinksabin opened this issue 3 years ago • 2 comments

Hi,

It seems like the the plugin is not working 100% in latest sonarqube 9.6.1. Apologies, I'm not a C++ developer and not quite sure about the issues show here. A screenshot attached, it doesnt show anything. sonar-scanner log below Uploading Screenshot 2022-09-14 at 15.55.09.png…

15:17:45.594 INFO: ------------- Run sensors on project
15:17:45.693 DEBUG: 'CXX verify analysis parameters' skipped because one of the required properties is missing
15:17:45.693 DEBUG: 'XSL transformation(s)' skipped because one of the required properties is missing
15:17:45.694 DEBUG: 'Generic Coverage Report' skipped because one of the required properties is missing
15:17:45.695 DEBUG: 'CXX RATS report import' skipped because there is no related rule activated in the quality profile
15:17:45.696 DEBUG: 'CXX Cppcheck report import' skipped because there is no related rule activated in the quality profile
15:17:45.696 DEBUG: 'CXX Infer report import' skipped because there is no related rule activated in the quality profile
15:17:45.697 DEBUG: 'CXX PC-lint report import' skipped because there is no related rule activated in the quality profile
15:17:45.697 DEBUG: 'CXX Dr. Memory report import' skipped because there is no related rule activated in the quality profile
15:17:45.697 DEBUG: 'CXX GCC compiler report import' skipped because there is no related rule activated in the quality profile
15:17:45.698 DEBUG: 'CXX Visual C++ compiler report import' skipped because there is no related rule activated in the quality profile
15:17:45.698 DEBUG: 'CXX Vera++ report import' skipped because there is no related rule activated in the quality profile
15:17:45.698 DEBUG: 'CXX Valgrind report import' skipped because there is no related rule activated in the quality profile
15:17:45.699 DEBUG: 'CXX Clang-Tidy report import' skipped because there is no related rule activated in the quality profile
15:17:45.699 DEBUG: 'CXX Clang Static Analyzer report import' skipped because there is no related rule activated in the quality profile
15:17:45.700 DEBUG: 'CXX other analyser report import' skipped because there is no related rule activated in the quality profile
15:17:45.700 DEBUG: 'CXX xUnit Test report import' skipped because one of the required properties is missing
15:17:45.700 DEBUG: 'CXX VSTest/NUnit Test report import' skipped because one of the required properties is missing
15:17:45.701 DEBUG: 'CXX Bullseye coverage report import' skipped because one of the required properties is missing
15:17:45.701 DEBUG: 'CXX Cobertura XML coverage report import' skipped because one of the required properties is missing
15:17:45.701 DEBUG: 'CXX Testwell CTC++ TXT coverage report import' skipped because one of the required properties is missing
15:17:45.702 DEBUG: 'CXX Visual Studio XML coverage report import' skipped because one of the required properties is missing
15:17:45.702 DEBUG: 'C#' skipped because there is no related file in current project
15:17:45.702 DEBUG: 'C# Tests Coverage Report Import' skipped because there is no related file in current project
15:17:45.702 DEBUG: '[Deprecated] C# Integration Tests Coverage Report Import' skipped because there is no related file in current project
15:17:45.703 DEBUG: 'C# Unit Test Results Import' skipped because there is no related file in current project
15:17:45.703 DEBUG: 'VB.NET' skipped because there is no related file in current project
15:17:45.704 DEBUG: 'VB.NET Tests Coverage Report Import' skipped because there is no related file in current project
15:17:45.704 DEBUG: '[Deprecated] VB.NET Integration Tests Coverage Report Import' skipped because there is no related file in current project
15:17:45.704 DEBUG: 'VB.NET Unit Test Results Import' skipped because there is no related file in current project
15:17:45.704 DEBUG: 'Java CPD Block Indexer' skipped because there is no related file in current project
15:17:45.705 DEBUG: Sensors : CXX -> Analysis Warnings import -> Zero Coverage Sensor
15:17:45.705 INFO: Sensor CXX [cxx]
15:17:45.796 DEBUG: sonar.cxx.metric.api.file.suffixes: [.hxx, .hpp, .hh, .h]
15:17:45.801 DEBUG: 'Complex Functions' metric threshold (cyclomatic complexity): 10
15:17:45.801 DEBUG: 'Big Functions' metric threshold (LOC): 20
15:17:45.831 DEBUG: global include directories: []
15:17:45.832 DEBUG: global macros: [{__STDC__:1}, {__has_c_attribute(x):0}, {__has_extension(x):0}, {__has_cpp_attribute(x):0}, {__STDC_HOSTED__:1}, {__has_builtin(x):0}, {__FILE__:"file"}, {__has_feature(x):0}, {__DATE__:"??? ?? ????"}, {__has_warning(x):0}, {__LINE__:1}, {__is_identifier(x):1}, {__TIME__:"??:??:??"}, {__has_include_next:__has_include_next}, {__has_declspec_attribute(x):0}, {__has_include:__has_include}, {__cplusplus:201402L}, {__has_attribute(x):0}]
15:17:45.832 DEBUG: process unit '/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/main.cpp'
15:17:45.853 DEBUG: [/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/main.cpp:1]: preprocessor cannot find include file '#include <iostream>'
15:17:45.855 DEBUG: [/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/main.cpp:2]: preprocessor cannot find include file '#include <conio.h>'
15:17:45.856 DEBUG: [/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/main.cpp:3]: preprocessor cannot find include file '#include <string>'
15:17:45.856 DEBUG: [/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/main.cpp:4]: preprocessor cannot find include file '#include <windows.h>'
15:17:45.927 DEBUG: process unit '/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/bookreaderapp/Book_Reader_Project.cpp'
15:17:45.938 DEBUG: [/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/bookreaderapp/Book_Reader_Project.cpp:4]: preprocessor cannot find include file '#include<bits/stdc++.h>'
15:17:45.939 DEBUG: [/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/bookreaderapp/Book_Reader_Project.cpp:5]: preprocessor cannot find include file '#include<iostream>'
15:17:45.939 DEBUG: [/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/bookreaderapp/Book_Reader_Project.cpp:6]: preprocessor cannot find include file '#include<vector>'
15:17:45.940 DEBUG: [/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/bookreaderapp/Book_Reader_Project.cpp:7]: preprocessor cannot find include file '#include<ctime>'
15:17:45.940 DEBUG: [/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/bookreaderapp/Book_Reader_Project.cpp:8]: preprocessor cannot find include file '#include<sstream>'
15:17:45.940 DEBUG: [/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/bookreaderapp/Book_Reader_Project.cpp:9]: preprocessor cannot find include file '#include<map>'
15:17:45.940 DEBUG: [/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/bookreaderapp/Book_Reader_Project.cpp:10]: preprocessor cannot find include file '#include<set>'
15:17:45.941 DEBUG: [/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/bookreaderapp/Book_Reader_Project.cpp:11]: preprocessor cannot find include file '#include<chrono>		'
15:17:45.941 DEBUG: [/Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/bookreaderapp/Book_Reader_Project.cpp:12]: preprocessor cannot find include file '#include<iomanip>		'
15:17:46.105 INFO: Sensor CXX [cxx] (done) | time=400ms
15:17:46.105 INFO: Sensor Analysis Warnings import [csharp]
15:17:46.106 INFO: Sensor Analysis Warnings import [csharp] (done) | time=1ms
15:17:46.106 INFO: Sensor Zero Coverage Sensor
15:17:46.119 INFO: Sensor Zero Coverage Sensor (done) | time=13ms
15:17:46.125 INFO: SCM Publisher SCM provider for this project is: git
15:17:46.128 INFO: SCM Publisher 1 source file to be analyzed
15:17:46.133 DEBUG: Collecting committed files
15:17:46.153 DEBUG: Thread[JGit-FileStoreAttributeReader-1,5,main]: start measure timestamp resolution /System/Volumes/Data (/dev/disk1s1) in /Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/.git
15:17:46.157 DEBUG: Thread[JGit-FileStoreAttributeReader-1,5,main]: end measure timestamp resolution /System/Volumes/Data (/dev/disk1s1) in /Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/.git; got PT0.000004S
15:17:46.158 DEBUG: Thread[JGit-FileStoreAttributeReader-1,5,main]: start measure minimal racy interval in /Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/.git
15:17:46.257 DEBUG: Thread[main,5,main]: use fallback timestamp resolution for directory /Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/.git
15:17:46.276 DEBUG: Collecting committed files (done) | time=143ms
15:17:46.313 INFO: SCM Publisher 0/1 source files have been analyzed (done) | time=184ms
15:17:46.313 WARN: Missing blame information for the following files:
15:17:46.314 WARN:   * src/bookreaderapp/Book_Reader_Project.cpp
15:17:46.314 WARN: This may lead to missing/broken features in SonarQube
15:17:46.320 INFO: CPD Executor Calculating CPD for 2 files
15:17:46.320 DEBUG: Detection of duplications for /Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/bookreaderapp/Book_Reader_Project.cpp
15:17:46.330 DEBUG: Detection of duplications for /Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/src/main.cpp
15:17:46.331 INFO: CPD Executor CPD calculation finished (done) | time=11ms
15:17:46.346 DEBUG: SCM revision ID 'b8d6e2e6c18554d60193c616b35c234f6c13aa40'
15:17:46.431 INFO: Load New Code definition
15:17:46.443 DEBUG: GET 200 http://172.16.226.138:9000/api/new_code_periods/show.protobuf?project=sonarqube-cpp-test-book-2&branch=master | time=9ms
15:17:46.446 INFO: Load New Code definition (done) | time=14ms
15:17:46.456 INFO: Analysis report generated in 119ms, dir size=162.6 kB
15:17:46.530 INFO: Analysis report compressed in 74ms, zip size=29.2 kB
15:17:46.530 INFO: Analysis report generated in /Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/.scannerwork/scanner-report
15:17:46.530 DEBUG: Upload report
15:17:46.564 DEBUG: POST 200 http://172.16.226.138:9000/api/ce/submit?projectKey=sonarqube-cpp-test-book-2 | time=33ms
15:17:46.569 INFO: Analysis report uploaded in 39ms
15:17:46.571 DEBUG: Report metadata written to /Users/sabin_ranjit/Downloads/sample-cpp-projects/Snake-CPP/.scannerwork/report-task.txt
15:17:46.571 INFO: ANALYSIS SUCCESSFUL, you can find the results at: http://172.16.226.138:9000/dashboard?id=sonarqube-cpp-test-book-2
15:17:46.571 INFO: Note that you will be able to access the updated dashboard once the server has processed the submitted analysis report
15:17:46.571 INFO: More about the report processing at http://172.16.226.138:9000/api/ce/task?id=AYM8XO1wfCvfe-V25kw5
15:17:46.575 DEBUG: Post-jobs : Final report
15:17:46.575 INFO: Executing post-job 'Final report'
15:17:46.575 WARN: Preprocessor: 13 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.
15:17:46.596 INFO: Analysis total time: 6.031 s
15:17:46.601 INFO: ------------------------------------------------------------------------
15:17:46.601 INFO: EXECUTION SUCCESS

Desktop (please complete the following information):

  • OS: Linux
  • SonarQube version: 9.6.1 community edition
  • cxx plugin version: 2.1.0.253 latest snapshot
  • sonar-scanner version: 4.7.0.2747

Additional context Add any other context about the problem here.

thinksabin avatar Sep 14 '22 15:09 thinksabin

Hi @thinksabin,

I can't open your PNG file. What exactly is your problem?

Did you read this?

  • https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Scan-Source-Code
  • https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Scan-Report-Files
    • most likely the problem is this: https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Manage-Quality-Profiles

Regards,

guwirth avatar Sep 14 '22 16:09 guwirth

I think it was the issue you guessed. I will do further testing and will update you. thanks @guwirth

thinksabin avatar Sep 22 '22 16:09 thinksabin