Empty project scan with only duplications

I have this also, doing buildWrapper on Linux, which outputs json, and then sending this to Windows sonar - nothing but duplication checks… Sonar seems broken…

Having this on Linux - “compiler”:“clang”, “executable”:"/opt/llvm-6.0/bin/clang-6.0" - will analysis now be empty if sent to sonarqube on windows ???

Hi @PeterH,

I moved your posts to a new thread, can you describe a bit what you are trying to do? Are you trying to run sonar-scanner on windows while you build your project on linux? Be aware that build-wrapper and sonar-scanner must be ran on the same machine.

running buildwrapper on make, which outputs into json file. This unfortunately cannot be done in parallel for each library/class, but only in seq ? The sonar-scanner is then run, which scans the cpp and header files and uploads to sonar cube. Nothing shows but duplication in code… buildwrapper and sonar-scanner runs on linux and sonar-cube server on windows - is this supported ?

@PeterH I moved your posts on the same thread.

I run build-wrapper and sonar-scanner in docker (linux hence) and upload results to cube on windows. json file is not empty… however cube only shows duplication results…

Hi @PeterH,

could you please share the build-wrapper-dump.json file and the sonar-scanner log output?

INFO: Using build-wrapper output: /code/reviews/build-wrapper-dump.json
INFO: Available processors: 2
INFO: Using 1 thread for analysis according to value of “sonar.cfamily.threads” property.
INFO: Load project repositories
INFO: Load project repositories (done) | time=62ms
WARN: Metric ‘comment_lines_data’ is deprecated. Provided value is ignored.
WARN: Invalid character encountered in file /sonar-scanner/bin/accessory/XXXXX.cpp at line 19 for encoding UTF-8. Please fix file content or configure the encoding to be used using property ‘sonar.sourceEncoding’.
INFO: 0 compilation units analyzed
INFO: Sensor CFamily [cpp] (done) | time=5171ms
INFO: Sensor JavaSecuritySensor [security]
INFO: Reading type hierarchy from: /sonar-scanner/bin/.scannerwork/ucfg2/java
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /sonar-scanner/bin/.scannerwork/ucfg2/java
INFO: No UCFGs have been included for analysis.
INFO: Sensor JavaSecuritySensor [security] (done) | time=11ms
INFO: Sensor CSharpSecuritySensor [security]
INFO: Reading type hierarchy from: /sonar-scanner/bin/ucfg_cs2
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /sonar-scanner/bin/ucfg_cs2
INFO: No UCFGs have been included for analysis.
INFO: Sensor CSharpSecuritySensor [security] (done) | time=6ms
INFO: Sensor PhpSecuritySensor [security]
INFO: Reading type hierarchy from: /sonar-scanner/bin/.scannerwork/ucfg2/php
INFO: Read 0 type definitions
INFO: Reading UCFGs from: /sonar-scanner/bin/.scannerwork/ucfg2/php
INFO: No UCFGs have been included for analysis.
INFO: Sensor PhpSecuritySensor [security] (done) | time=3ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=27ms
INFO: No SCM system was detected. You can use the ‘sonar.scm.provider’ property to explicitly specify it.
INFO: 54 files had no CPD blocks
INFO: Calculating CPD for 757 files
INFO: CPD calculation finished
INFO: Analysis report generated in 437ms, dir size=10 MB
INFO: Analysis report compressed in 1291ms, zip size=3 MB
INFO: Analysis report uploaded in 434ms


Thu Jul 25 07:15:11 2019: build-wrapper, version 6.3 (linux-x86)
Thu Jul 25 07:15:11 2019: System name: Linux Nodename: d10cf7c3ee21 Release: 4.9.125-linuxkit Version: #1 SMP Fri Sep 7 08:20:28 UTC 2018 Machine: x86_64
Thu Jul 25 07:15:11 2019: socket path: /tmp/build-wrapper-socket.Qfxfwu
Thu Jul 25 07:15:11 2019: dynamic library found: /codereview/libinterceptor-i686.so
Thu Jul 25 07:15:11 2019: dynamic library found: /codereview/libinterceptor-x86_64.so
Thu Jul 25 07:15:11 2019: command executed as: </codereview/build-wrapper-linux-x86-64>

possible to run buildwrapper for subprojects in parallel, and hence output multiple json files… and merge them for analysis ?

java.lang.IllegalStateException: Unrecoverable indexation failures: 1 errors among 1 requests
at org.sonar.server.es.IndexingListener$1.onFinish(IndexingListener.java:39)
at org.sonar.server.es.BulkIndexer.stop(BulkIndexer.java:122)
at org.sonar.server.measure.index.ProjectMeasuresIndexer.doIndex(ProjectMeasuresIndexer.java:158)
at org.sonar.server.measure.index.ProjectMeasuresIndexer.indexOnAnalysis(ProjectMeasuresIndexer.java:82)
at org.sonar.ce.task.projectanalysis.step.IndexAnalysisStep.execute(IndexAnalysisStep.java:45)
at org.sonar.ce.task.step.ComputationStepExecutor.executeStep(ComputationStepExecutor.java:81)
at org.sonar.ce.task.step.ComputationStepExecutor.executeSteps(ComputationStepExecutor.java:72)
at org.sonar.ce.task.step.ComputationStepExecutor.execute(ComputationStepExecutor.java:59)
at org.sonar.ce.task.projectanalysis.taskprocessor.ReportTaskProcessor.process(ReportTaskProcessor.java:81)
at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.executeTask(CeWorkerImpl.java:209)
at org.sonar.ce.taskprocessor.CeWorkerImpl$ExecuteTask.run(CeWorkerImpl.java:191)
at org.sonar.ce.taskprocessor.CeWorkerImpl.findAndProcessTask(CeWorkerImpl.java:158)
at org.sonar.ce.taskprocessor.CeWorkerImpl$TrackRunningState.get(CeWorkerImpl.java:133)
at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:85)
at org.sonar.ce.taskprocessor.CeWorkerImpl.call(CeWorkerImpl.java:53)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
at java.base/java.lang.Thread.run(Thread.java:835)

do you use sonar on sonar code ?!!

Hi @PeterH,

did you manage to solve your issue?

Yes, works with developer version, but empty analysis results (only dups) with community + c++ jar plug-in… Clang 6 compiler

Hi @PeterH,

SonarSource C/C++ analyzer is available only starting with developer edition, it is expected that if you take community edition and copy sonar-cfamily jars it doesn’t work.

community version with community c++ plug-in (SonarOpenCommunity/sonar-cxx) gives nothing…

Hi @PeterH,

we don’t support community c++ plugin, please contact its support channel. We only support SonarSource C/C++ analyzer that you can have starting with SonarQube developer edition or for free (for open-source projects) on SonarCloud.io.