SonarOpenCommunity / sonar-cxx

SonarQube C++ Community plugin (cxx plugin): This plugin adds C++ support to SonarQube with the focus on integration of existing C++ tools.
GNU Lesser General Public License v3.0
1k stars 363 forks source link

sonar-cxx with SonarQube 10.5 community version #2696

Closed huyhoang8398 closed 5 months ago

huyhoang8398 commented 5 months ago

Describe the bug SonarScan find warning and issue but when check in SonarQube, it's empty

To Reproduce Steps to reproduce the behavior:

Expected behavior SonarQube has issue and warning from sonarscanner

Screenshots image image

Desktop (please complete the following information):

huyhoang8398 commented 5 months ago

debug log:

Skipping Git submodules setup
section_end:1718959742:get_sources
section_start:1718959742:restore_cache
Restoring cache
Checking cache for sonarqube-check-non_protected...
No URL provided, cache will not be downloaded from shared cache server. Instead a local version of cache will be extracted. 
Successfully extracted cache
section_end:1718959745:restore_cache
section_start:1718959745:step_script
Executing "step_script" stage of the job script
Using docker image sha256:fd964ae82ee4d1d5d637a31e1f42fd00bef27035569565f66f84d1318d863900 for sonarsource/sonar-scanner-cli:5.0 with digest sonarsource/sonar-scanner-cli@sha256:02372948eaeeb10dfbe0cfd4174d44b8e405d0aeae431532b2bdb21d0347bf23 ...
$ sonar-scanner
INFO: Scanner configuration file: /opt/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: /builds/hoang.do/IN_MAIN/sonar-project.properties
INFO: SonarScanner 5.0.1.3006
INFO: Java 17.0.10 Alpine (64-bit)
INFO: Linux 5.15.0-112-generic amd64
INFO: User cache: /builds/hoang.do/IN_MAIN/.sonar/cache
INFO: Analyzing on SonarQube server 10.5.1.90531
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=184ms
INFO: Server id: 92D88F0A-AY_j7p3mGOxMsmIExRJp
INFO: User cache: /builds/hoang.do/IN_MAIN/.sonar/cache
INFO: Loading required plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=185ms
INFO: Load/download plugins
INFO: Load/download plugins (done) | time=250ms
INFO: Process project properties
INFO: Process project properties (done) | time=8ms
INFO: Project key: hoang.do_IN_MAIN_20e8bbcb-4d5a-4ae6-a8eb-09edff1c6e7a
INFO: Base dir: /builds/hoang.do/IN_MAIN
INFO: Working dir: /builds/hoang.do/IN_MAIN/.scannerwork
INFO: Load project settings for component key: 'hoang.do_IN_MAIN_20e8bbcb-4d5a-4ae6-a8eb-09edff1c6e7a'
INFO: Load project settings for component key: 'hoang.do_IN_MAIN_20e8bbcb-4d5a-4ae6-a8eb-09edff1c6e7a' (done) | time=57ms
INFO: Load project branches
INFO: Load project branches (done) | time=74ms
INFO: Load branch configuration
INFO: Auto detected BRANCH configuration with source feat/ci-cd using com.github.mc1arke.sonarqube.plugin.scanner.autoconfiguration.GitlabCiAutoConfigurer
INFO: Load branch configuration (done) | time=9ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=121ms
INFO: Auto-configuring with CI 'Gitlab CI'
INFO: Load active rules
INFO: Load active rules (done) | time=3156ms
INFO: Load analysis cache
INFO: Load analysis cache (404) | time=16ms
INFO: Branch name: feat/ci-cd
INFO: Preprocessing files...
INFO: 1 language detected in 619 preprocessed files
INFO: Loading plugins for detected languages
INFO: Load/download plugins
INFO: Load/download plugins (done) | time=0ms
INFO: Inconsistent constructor declaration on bean with name 'org.sonarsource.scanner.api.internal.IsolatedClassloader@2173f6d9-org.sonar.scanner.issue.IssueFilters': single autowire-marked constructor flagged as optional - this constructor is effectively required since there is no default constructor to fall back to: public org.sonar.scanner.issue.IssueFilters(org.sonar.api.batch.fs.internal.DefaultInputProject)
INFO: Load project repositories
INFO: Load project repositories (done) | time=84ms
INFO: Indexing files...
INFO: Project configuration:
INFO: 619 files indexed
INFO: Quality profile for cxx: Sonar way
INFO: ------------- Run sensors on module hoang.do_IN_MAIN_20e8bbcb-4d5a-4ae6-a8eb-09edff1c6e7a
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=35ms
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=2ms
INFO: Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerPullRequestPropertySensor
INFO: Sensor com.github.mc1arke.sonarqube.plugin.scanner.ScannerPullRequestPropertySensor (done) | time=1ms
INFO: Sensor IaC Docker Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Docker Sensor [iac] (done) | time=89ms
INFO: Sensor TextAndSecretsSensor [text]
INFO: Available processors: 2
INFO: Using 2 threads for analysis.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/VARS/VARS_PUBLICS/VarPub_Desc.c at line 11848 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/MISC/DebugBase.c at line 454 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/FPGA/Lib/awFPGA_AWGT_RX_VIDEO.h at line 132 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/FPGA/LANCEL_1.c at line 146 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/HAL_FE_IP_SDI_DeviceInit.c at line 204 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/VARS/VARS_PUBLICS/VarPub_INPUT_PLUG_Fct.c at line 121 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/VARS/VARS_PUBLICS/VarPub_INPUT_SIGNALS_Fct.c at line 86 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/HAL_FE_IP_SDI.c at line 197 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/LLD.c at line 490 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/LLD.h at line 203 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/VARS/VARS_PUBLICS/VarPub_INPUT_PATTERN_MEMORY_Fct.c at line 150 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/VARS/VARS_PUBLICS/VarPub_EDID_IN_Fct.c at line 169 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/HAL_FE_SFP.c at line 196 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/HAL.c at line 555 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/VARS/VARS_PUBLICS/VarPub_INTERNAL_PROCESSING_Fct.c at line 117 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/HAL.h at line 320 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/HAL_DeviceInit.c at line 276 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/HAL_FE_DP.c at line 201 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/VARS/VARS_PUBLICS/VarPub_INPUT_Fct.c at line 116 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/FPGA/MasterFPGA.c at line 156 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/FND.c at line 165 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/FND.h at line 385 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/HAL_FE_SDVOE.c at line 210 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/MISC/CardStatus.c at line 695 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/HAL_FE_SDI.c at line 192 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/MISC/CardStatus.h at line 150 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/HAL_FE_OPTIC.c at line 202 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/FPGA/LANCEL_2.c at line 145 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/HAL_FE_HDMI.c at line 200 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
WARN: Invalid character encountered in file /builds/hoang.do/IN_MAIN/Src/HAL_FE_CAP.c at line 184 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.
INFO: 618 source files to be analyzed
INFO: 46/618 files analyzed, current files: Src/HAL.c, Src/HAL_FE_DP.c
INFO: 618/618 source files have been analyzed
INFO: Sensor TextAndSecretsSensor [text] (done) | time=17486ms
INFO: ------------- Run sensors on project
INFO: Sensor CXX [cxx]
INFO: Sensor CXX [cxx] (done) | time=22348ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=76ms
INFO: SCM Publisher is disabled
INFO: CPD Executor 344 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 274 files
INFO: CPD Executor CPD calculation finished (done) | time=150ms
INFO: SCM revision ID '15b79b3e378ae20785199fa9454a48e64a954e9e'
INFO: Analysis report generated in 748ms, dir size=28.5 MB
INFO: Analysis report compressed in 1001ms, zip size=4.5 MB
INFO: Analysis report uploaded in 332ms
INFO: ------------- Check Quality Gate status
INFO: Waiting for the analysis report to be processed (max 300s)
INFO: QUALITY GATE STATUS: PASSED - View details on http://192.168.0.59:9000/dashboard?id=hoang.do_IN_MAIN_20e8bbcb-4d5a-4ae6-a8eb-09edff1c6e7a&branch=feat%2Fci-cd
INFO: Executing post-job 'Final report'
WARN: Preprocessor: 7653 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.
WARN: Source code parser: 65 syntax error(s) detected. Syntax errors could cause invalid software metric values. Root cause are typically missing includes, missing macros or compiler specific extensions.
INFO: Turn debug info on to get more details (sonar-scanner -X -Dsonar.verbose=true ...).
INFO: Analysis total time: 1:07.892 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:09.778s
INFO: Final Memory: 14M/54M
INFO: ------------------------------------------------------------------------
Exception in thread "Thread-0" java.lang.NoClassDefFoundError: ch/qos/logback/classic/spi/ThrowableProxy
    at ch.qos.logback.classic.spi.LoggingEvent.<init>(LoggingEvent.java:145)
    at ch.qos.logback.classic.Logger.buildLoggingEventAndAppend(Logger.java:424)
    at ch.qos.logback.classic.Logger.filterAndLog_0_Or3Plus(Logger.java:386)
    at ch.qos.logback.classic.Logger.error(Logger.java:543)
    at org.eclipse.jgit.internal.util.ShutdownHook.cleanup(ShutdownHook.java:87)
    at java.base/java.lang.Thread.run(Thread.java:840)
Caused by: java.lang.ClassNotFoundException: ch.qos.logback.classic.spi.ThrowableProxy
    at java.base/java.net.URLClassLoader.findClass(URLClassLoader.java:445)
    at org.sonarsource.scanner.api.internal.IsolatedClassloader.loadClass(IsolatedClassloader.java:82)
    at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:525)
    ... 6 more
section_end:1718959815:step_script
section_start:1718959815:archive_cache
Saving cache for successful job
Creating cache sonarqube-check-non_protected...
.sonar/cache: found 147 matching artifact files and directories 
No URL provided, cache will not be uploaded to shared cache server. Cache will be stored only locally. 
Created cache
section_end:1718959821:archive_cache
section_start:1718959821:cleanup_file_variables
Cleaning up project directory and file based variables
section_end:1718959821:cleanup_file_variables
Job succeeded