sonarqube error : not authorized to run analysis - sonarqube

I am trying to execute sonarqube in my local machine. I am getting the following output error.
ERROR: Error during SonarScanner execution
ERROR: You're not authorized to run analysis. Please contact the project administrator.
I have checked various documents but not able to get a resolution.
I am executing the following:
sonar-scanner.bat -D"sonar.projectKey=test-key" -D"sonar.sources=." -D"sonar.host.url=http://localhost:9000" -D"sonar.login=<token>"
Getting the following output
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=129ms
INFO: Load active rules
INFO: Load active rules (done) | time=3890ms
INFO: Load analysis cache
INFO: Load analysis cache (404) | time=16ms
INFO: Load project repositories
INFO: Load project repositories (done) | time=16ms
INFO: Indexing files...
INFO: Project configuration:
INFO: 320 files indexed
INFO: 223 files ignored because of scm ignore settings
INFO: Quality profile for cs: Sonar way
INFO: Quality profile for css: Sonar way
INFO: Quality profile for js: Sonar way
INFO: Quality profile for json: Sonar way
INFO: Quality profile for py: Sonar way
INFO: Quality profile for terraform: Sonar way
INFO: Quality profile for ts: Sonar way
INFO: Quality profile for web: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: Quality profile for yaml: Sonar way
INFO: ------------- Run sensors on module test-key
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=69ms
INFO: Sensor Python Sensor [python]
WARN: Your code is analyzed as compatible with python 2 and 3 by default. This will prevent the detection of issues specific to python 2 or python 3. You can get a more precise analysis by setting a python version in your configuration via the parameter "sonar.python.version"
INFO: Starting global symbols computation
INFO: 15 source files to be analyzed
INFO: 15/15 source files have been analyzed
INFO: Starting rules execution
INFO: 15 source files to be analyzed
INFO: 15/15 source files have been analyzed
INFO: Sensor Python Sensor [python] (done) | time=3831ms
INFO: Sensor Cobertura Sensor for Python coverage [python]
INFO: Sensor Cobertura Sensor for Python coverage [python] (done) | time=77ms
INFO: Sensor PythonXUnitSensor [python]
INFO: Sensor PythonXUnitSensor [python] (done) | time=45ms
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=11ms
INFO: Sensor IaC Terraform Sensor [iac]
INFO: 15 source files to be analyzed
INFO: 15/15 source files have been analyzed
INFO: Sensor IaC Terraform Sensor [iac] (done) | time=553ms
INFO: Sensor IaC CloudFormation Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC CloudFormation Sensor [iac] (done) | time=490ms
INFO: Sensor IaC Kubernetes Sensor [iac]
INFO: 0 source files to be analyzed
INFO: 0/0 source files have been analyzed
INFO: Sensor IaC Kubernetes Sensor [iac] (done) | time=163ms
INFO: Sensor JavaScript analysis [javascript]
ERROR: INFO: Could not find files for the given pattern(s).
ERROR: Node.js not found in PATH. PATH value was: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\Program Files\Git\cmd;C:\Program Files\Pandoc\;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Users\r4vmadmin\.pyenv\pyenv-win\bin;C:\Users\r4vmadmin\.pyenv\pyenv-win\shims;C:\Users\r4vmadmin\AppData\Local\Microsoft\WindowsApps;C:\Users\r4vmadmin\.dotnet\tools;C:\Users\r4vmadmin\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\Azure Data Studio\bin;F:\sonar-scanner-4.7.0.2747-windows\bin;
org.sonarsource.nodejs.NodeCommandException: Node.js not found in PATH. PATH value was: C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\Microsoft SQL Server\150\Tools\Binn\;C:\Program Files\Microsoft SQL Server\Client SDK\ODBC\170\Tools\Binn\;C:\Program Files\dotnet\;C:\Program Files (x86)\Microsoft SQL Server\150\DTS\Binn\;C:\Program Files\Azure Data Studio\bin;C:\Program Files\Git\cmd;C:\Program Files\Pandoc\;C:\Program Files\Docker\Docker\resources\bin;C:\ProgramData\DockerDesktop\version-bin;C:\Users\r4vmadmin\.pyenv\pyenv-win\bin;C:\Users\r4vmadmin\.pyenv\pyenv-win\shims;C:\Users\r4vmadmin\AppData\Local\Microsoft\WindowsApps;C:\Users\r4vmadmin\.dotnet\tools;C:\Users\r4vmadmin\AppData\Local\Programs\Microsoft VS Code\bin;C:\Program Files\Azure Data Studio\bin;F:\sonar-scanner-4.7.0.2747-windows\bin;
at org.sonarsource.nodejs.NodeCommandBuilderImpl.locateNodeOnWindows(NodeCommandBuilderImpl.java:270)
at org.sonarsource.nodejs.NodeCommandBuilderImpl.locateNode(NodeCommandBuilderImpl.java:232)
at org.sonarsource.nodejs.NodeCommandBuilderImpl.retrieveNodeExecutableFromConfig(NodeCommandBuilderImpl.java:224)
at org.sonarsource.nodejs.NodeCommandBuilderImpl.build(NodeCommandBuilderImpl.java:142)
at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.initNodeCommand(EslintBridgeServerImpl.java:183)
at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.startServer(EslintBridgeServerImpl.java:128)
at org.sonar.plugins.javascript.eslint.EslintBridgeServerImpl.startServerLazily(EslintBridgeServerImpl.java:212)
at org.sonar.plugins.javascript.eslint.AbstractEslintSensor.execute(AbstractEslintSensor.java:66)
at org.sonar.scanner.sensor.AbstractSensorWrapper.analyse(AbstractSensorWrapper.java:64)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:88)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.lambda$execute$1(ModuleSensorsExecutor.java:61)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.withModuleStrategy(ModuleSensorsExecutor.java:79)
at org.sonar.scanner.sensor.ModuleSensorsExecutor.execute(ModuleSensorsExecutor.java:61)
at org.sonar.scanner.scan.SpringModuleScanContainer.doAfterStart(SpringModuleScanContainer.java:81)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.scanner.scan.SpringProjectScanContainer.scan(SpringProjectScanContainer.java:396)
at org.sonar.scanner.scan.SpringProjectScanContainer.scanRecursively(SpringProjectScanContainer.java:392)
at org.sonar.scanner.scan.SpringProjectScanContainer.doAfterStart(SpringProjectScanContainer.java:361)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.scanner.bootstrap.SpringGlobalContainer.doAfterStart(SpringGlobalContainer.java:135)
at org.sonar.core.platform.SpringComponentContainer.startComponents(SpringComponentContainer.java:188)
at org.sonar.core.platform.SpringComponentContainer.execute(SpringComponentContainer.java:167)
at org.sonar.batch.bootstrapper.Batch.doExecute(Batch.java:72)
at org.sonar.batch.bootstrapper.Batch.execute(Batch.java:66)
at org.sonarsource.scanner.api.internal.batch.BatchIsolatedLauncher.execute(BatchIsolatedLauncher.java:46)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.base/java.lang.reflect.Method.invoke(Unknown Source)
at org.sonarsource.scanner.api.internal.IsolatedLauncherProxy.invoke(IsolatedLauncherProxy.java:60)
at com.sun.proxy.$Proxy0.execute(Unknown Source)
at org.sonarsource.scanner.api.EmbeddedScanner.doExecute(EmbeddedScanner.java:189)
at org.sonarsource.scanner.api.EmbeddedScanner.execute(EmbeddedScanner.java:138)
at org.sonarsource.scanner.cli.Main.execute(Main.java:112)
at org.sonarsource.scanner.cli.Main.execute(Main.java:75)
at org.sonarsource.scanner.cli.Main.main(Main.java:61)
INFO: Sensor JavaScript analysis [javascript] (done) | time=23150ms
INFO: Sensor TypeScript analysis [javascript]
INFO: Sensor TypeScript analysis [javascript] (done) | time=2ms
INFO: Sensor JavaScript inside YAML analysis [javascript]
INFO: Sensor JavaScript inside YAML analysis [javascript] (done) | time=1ms
INFO: Sensor CSS Metrics [javascript]
INFO: Sensor CSS Metrics [javascript] (done) | time=265ms
INFO: Sensor CSS Rules [javascript]
INFO: Sensor CSS Rules [javascript] (done) | time=2ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=2ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Sensor C# Analysis Log [csharp] (done) | time=48ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=2ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=611ms
INFO: Sensor XML Sensor [xml]
INFO: 1 source file to be analyzed
INFO: 1/1 source file has been analyzed
INFO: Sensor XML Sensor [xml] (done) | time=539ms
INFO: Sensor Text Sensor [text]
INFO: 224 source files to be analyzed
INFO: 224/224 source files have been analyzed
INFO: Sensor Text Sensor [text] (done) | time=1140ms
INFO: Sensor VB.NET Project Type Information [vbnet]
INFO: Sensor VB.NET Project Type Information [vbnet] (done) | time=2ms
INFO: Sensor VB.NET Analysis Log [vbnet]
INFO: Sensor VB.NET Analysis Log [vbnet] (done) | time=29ms
INFO: Sensor VB.NET Properties [vbnet]
INFO: Sensor VB.NET Properties [vbnet] (done) | time=1ms
INFO: ------------- Run sensors on project
INFO: Sensor C# [csharp]
WARN: Your project contains C# files which cannot be analyzed with the scanner you are using. To analyze C# or VB.NET, you must use the SonarScanner for .NET 5.x or higher, see https://redirect.sonarsource.com/doc/install-configure-scanner-msbuild.html
INFO: Sensor C# [csharp] (done) | time=3ms
INFO: Sensor Analysis Warnings import [csharp]
INFO: Sensor Analysis Warnings import [csharp] (done) | time=2ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=41ms
INFO: SCM Publisher SCM provider for this project is: git
INFO: SCM Publisher 184 source files to be analyzed
INFO: SCM Publisher 183/184 source files have been analyzed (done) | time=7157ms
WARN: Missing blame information for the following files:
WARN: * AcousticsDiagnostics_DashBoard/AcousticsDiagnostics.Python/Acoustics_Diag_Python_Azure_Functions/Acoustics_Diag_Python_Test/test_model_scripts.py
WARN: This may lead to missing/broken features in SonarQube
INFO: CPD Executor 6 files had no CPD blocks
INFO: CPD Executor Calculating CPD for 28 files
INFO: CPD Executor CPD calculation finished (done) | time=88ms
INFO: Analysis report generated in 512ms, dir size=1.0 MB
INFO: Analysis report compressed in 5443ms, zip size=374.6 kB
INFO: ------------------------------------------------------------------------
INFO: EXECUTION FAILURE
INFO: ------------------------------------------------------------------------
INFO: Total time: 1:05.298s
INFO: Final Memory: 27M/114M
INFO: ------------------------------------------------------------------------
ERROR: Error during SonarScanner execution
ERROR: You're not authorized to run analysis. Please contact the project administrator.
ERROR:
ERROR: Re-run SonarScanner using the -X switch to enable full debug logging.

Related

Cppcheck errors are not getting reported in SonarQube 7.9.5 using Sonar-cxx community plugin v1.3.3

I am having SonarQube Community Edition (v7.9.5) server running with sonar-cxx community plugin v1.3.3
Now for a test C++ project, I have generated cppcheck (v2.3) analysis report and ran sonar-scanner (https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-4.5.0.2216-linux.zip) as follows.
$ pwd
/testproj
$ ls
file1.cc
$ cat file1.cc
int main()
{
char a[10];
a[10] = 0;
return 0;
}
$ cppcheck --enable=all --xml . 2> cppcheck_issues.xml
$ cat cppcheck_issues.xml
<?xml version="1.0" encoding="UTF-8"?>
<results version="2">
<cppcheck version="2.3"/>
<errors>
<error id="arrayIndexOutOfBounds" severity="error" msg="Array &apos;a[10]&apos; accessed at index 10, which is out of bounds." verbose="Array &apos;a[10]&apos; accessed at index 10, which is out of bounds." cwe="788" hash="11923574308940205340">
<location file="file1.cc" line="4" column="2" info="Array index out of bounds"/>
</error>
<error id="unreadVariable" severity="style" msg="Variable &apos;a[10]&apos; is assigned a value that is never used." verbose="Variable &apos;a[10]&apos; is assigned a value that is never used." cwe="563" hash="9507758794529763218">
<location file="file1.cc" line="4" column="7"/>
<symbol>a[10]</symbol>
</error>
</errors>
</results>
$ sonar-scanner \
-Dsonar.host.url=<sonar-host-url>\
-Dsonar.login=<sonar-token>\
-Dsonar.projectName=testproj\
-Dsonar.projectKey=testproj\
-Dsonar.projectVersion=0.1\
-Dsonar.cxx.cppcheck.reportPath=cppcheck_issues.xml\
-Dsonar.exclusions=cppcheck_issues.xml
INFO: Scanner configuration file: /code/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.5.0.2216
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Linux 4.1.12-124.43.4.el7uek.x86_64 amd64
INFO: User cache: /root/.sonar/cache
INFO: Scanner configuration file: /code/sonar-scanner/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarQube server 7.9.5
INFO: Default locale: "en_US", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Load global settings
INFO: Load global settings (done) | time=142ms
INFO: Server id: 22633092-AXeMotAnTu7ckErSxqZC
INFO: User cache: /root/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=73ms
INFO: Load/download plugins (done) | time=141ms
INFO: Process project properties
INFO: Execute project builders
INFO: Execute project builders (done) | time=9ms
INFO: Project key: testproj
INFO: Base dir: /testproj
INFO: Working dir: /testproj/.scannerwork
INFO: Load project settings for component key: 'testproj'
INFO: Load project settings for component key: 'testproj' (done) | time=74ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=99ms
INFO: Load active rules
INFO: Load active rules (done) | time=1167ms
WARN: SCM provider autodetection failed. Please use "sonar.scm.provider" to define SCM of your project, or disable the SCM Sensor in the project settings.
INFO: Indexing files...
INFO: Project configuration:
INFO: Excluded sources: cppcheck_issues.xml
INFO: 1 file indexed
INFO: 0 files ignored because of inclusion/exclusion patterns
INFO: Quality profile for c++: Sonar way
INFO: ------------- Run sensors on module testproj
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=41ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/root/.sonar/cache/866bb1adbf016ea515620f1aaa15ec53/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: Sensor C++ (Community) SquidSensor [cxx]
INFO: Load project repositories
INFO: Load project repositories (done) | time=31ms
INFO: Sensor C++ (Community) SquidSensor [cxx] (done) | time=312ms
INFO: Sensor JaCoCo XML Report Importer [jacoco]
INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=9ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=3ms
INFO: Sensor HTML [web]
INFO: Sensor HTML [web] (done) | time=23ms
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: 1 file had no CPD blocks
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 157ms, dir size=79 KB
INFO: Analysis report compressed in 22ms, zip size=12 KB
INFO: Analysis report uploaded in 58ms
INFO: ANALYSIS SUCCESSFUL, you can browse <sonar-host-url>/dashboard?id=testproj
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 <sonar-host-url>/api/ce/task?id=AXeQLS1KTu7ckErSxt5M
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.510 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 7.283s
INFO: Final Memory: 12M/44M
INFO: ------------------------------------------------------------------------
Now the project is successfully created/updated in SonarQube; but, the issues are not reported in SonarQube. Someone would be able to suggest on what could be the reason?
Please refer the snapshot of the project in SonarQube
Note-1: sonar.cxx.suffixes.sources is configured to ".cc" value for C++ (Community) plugin in SonarQube server configuration. And, there are no other plugin seen present with the same configuration key.
Note-2: There are no errors/warnings seen in ce.log
The issue cause is found after doing some more digging.
Issue cause: The default quality profile corresponding to the C++ (Community) had their all rules disabled by default, and there was no option to enable them as well.
Fix: Created a new quality profile extending the default one, then enabled rules for that, and finally made it as the default quality profile for C++ (Community) solves the issue.
Update (16-Feb-'21): Got a clarification from sonar-cxx team that this is intentional as well, and the same is documented in https://github.com/SonarOpenCommunity/sonar-cxx/wiki/Manage-Quality-Profiles
Since the cxx plugin contains a large number of sensors with over 4000
rules, all rules are initially deactivated in the default profile
Sonar way for the programming language CXX. Enabling all rules would
have a negative impact on the analysis performance and mostly only a
subset is needed.
Therefore, after installation, no sensor issues are displayed. To
display issues, the corresponding rules must first be enabled in the
Quality Profile being used by the project.

SonarQube scan runs but doesn’t generate any results

I’m running a SonarQube scan for the first time. It’s the CE version, 8.3.1.
I have SQ running on a server at 192.168.56.111. My development workstation is on 192.168.0.11. There are no network problems.
Since I’m new to SQ, I’m trying to keep it as basic as possible. I’m using the sample HelloWorld in https://github.com/SonarSource/sonar-scanning-examples/blob/master/sonarqube-scanner-maven/maven-basic/src/main/java/com/acme/basic/
I’m not using Git. Just saving the HelloWorld project to the local hard drive
The source code is at /opt/workspace/eclipse/java/my-app/src/main/java/com/mycompany/app/
The scanner is at /opt/sonarqube/scanner/sonar-scanner-4.4.0.2170-linux/bin
Here’s a copy of the properties file. I’m using the same file whether or not I put it in the scanner’s conf directory or the application workspace… I’ve seen different webpages that say it goes in either spot:
sonar.host.url=http://192.168.56.111:9000
sonar.sourceEncoding=UTF-8
sonar.projectKey=com.mycompany.app:my-app
sonar.scm.disabled=True
sonar.sources=/opt/workspace/eclipse/java/my-app/src/main/java/com/mycompany/app
sonar.login=73a9a7ab66a335d0d83aee813d576e184934a336
When I run sonar-scanner and then go check the results, Projects | Name | Overview, it says "The main branch has no lines of code".
Question #1: If sonar.scm.disabled=True is in the props file, how can this error happen? I also went to the project settings in the SQ server and disabled the SCM sensor there too. Same results.
Question #2: I noticed in the terminal output, it said .java files are being ignored. So I changed the sonar.sources property to where the class files are at: /opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app/. Same results. What should the sonar.sources property be? Does SQ work on the java files or the class files?
The results say “No Issues. Hooray!”. So I added this but of ugliness to the sayHello method in the HelloWorld class:
KeyPairGenerator kpg = KeyPairGenerator.getInstance("RSA");
kpg.initialize(1024);
Question #3: Still no code issues. SQ should have flagged on the 1024 (as it’s less than 2048) size right?
==== Edit 23 August ====
Adding output from the terminal per #HernánAlarcón 's comment.
INFO: Scanner configuration file: /opt/sonarqube/scanner/sonar-scanner-4.4.0.2170-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarScanner 4.4.0.2170
INFO: Java 11.0.3 AdoptOpenJDK (64-bit)
INFO: Linux 3.10.0-1127.10.1.el7.x86_64 amd64
INFO: User cache: /home/dogzilla/.sonar/cache
INFO: Scanner configuration file: /opt/sonarqube/scanner/sonar-scanner-4.4.0.2170-linux/conf/sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: Analyzing on SonarQube server 8.3.1
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Load global settings
INFO: Load global settings (done) | time=69ms
INFO: Server id: A7EE8CF2-AXMiwj91ZEnoz7IhXD_G
INFO: User cache: /home/dogzilla/.sonar/cache
INFO: Load/download plugins
INFO: Load plugins index
INFO: Load plugins index (done) | time=36ms
INFO: Load/download plugins (done) | time=86ms
INFO: Process project properties
INFO: Process project properties (done) | time=7ms
INFO: Execute project builders
INFO: Execute project builders (done) | time=3ms
INFO: Project key: com.mycompany.app:my-app
INFO: Base dir: /opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app
INFO: Working dir: /opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app/.scannerwork
INFO: Load project settings for component key: 'com.mycompany.app:my-app'
INFO: Load project settings for component key: 'com.mycompany.app:my-app' (done) | time=17ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=40ms
INFO: Load active rules
INFO: Load active rules (done) | time=851ms
INFO: Indexing files...
INFO: Project configuration:
WARN: File '/opt/workspace/eclipse/java/my-app/src/main/java/com/mycompany/app/HelloWorld.java' is ignored. It is not located in project basedir '/opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app'.
WARN: File '/opt/workspace/eclipse/java/my-app/src/main/java/com/mycompany/app/AppRunner.java' is ignored. It is not located in project basedir '/opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app'.
WARN: File '/opt/workspace/eclipse/java/my-app/src/main/java/com/mycompany/app/sonar-scanner.properties' is ignored. It is not located in project basedir '/opt/workspace/eclipse/java/my-app/target/classes/com/mycompany/app'.
INFO: 0 files indexed
INFO: ------------- Run sensors on module com.mycompany.app:my-app
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=38ms
WARNING: An illegal reflective access operation has occurred
WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/home/dogzilla/.sonar/cache/54f6535c111cefad0fb6a09ba3e61922/sonar-javascript-plugin.jar) to method java.lang.ClassLoader.defineClass(java.lang.String,byte[],int,int,java.security.ProtectionDomain)
WARNING: Please consider reporting this to the maintainers of net.sf.cglib.core.ReflectUtils$1
WARNING: Use --illegal-access=warn to enable warnings of further illegal reflective access operations
WARNING: All illegal access operations will be denied in a future release
INFO: Sensor SonarCSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor SonarCSS Rules [cssfamily] (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=3ms
INFO: Sensor JavaXmlSensor [java]
INFO: Sensor JavaXmlSensor [java] (done) | time=0ms
INFO: ------------- Run sensors on project
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=0ms
INFO: SCM Publisher is disabled
INFO: CPD Executor Calculating CPD for 0 files
INFO: CPD Executor CPD calculation finished (done) | time=0ms
INFO: Analysis report generated in 70ms, dir size=77 KB
INFO: Analysis report compressed in 12ms, zip size=9 KB
INFO: Analysis report uploaded in 35ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://192.168.56.111:9000/dashboard?id=com.mycompany.app%3Amy-app
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://192.168.56.111:9000/api/ce/task?id=AXQeYMFVCyJo7mZCTWSk
INFO: Analysis total time: 2.802 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 3.561s
INFO: Final Memory: 6M/37M
INFO: ------------------------------------------------------------------------

SonarQube does not detect C# issues in Xamarin project

I want to use SonarQube to analyze C# code of a Xamarin.Forms project with an Android and iOS app. For that I created a demo app containing code issues taken from the SonarQube examples. However, these issues are not detected by SonarQube after scanning the code. What am I doing wrong?
I followed these instructions and installed on macOS Sierra:
SonarQube 6.7 LTS
SonarQube Scanner for MSBuild 4.0.1.883
SonarC# analyzer plugin 6.7 (build 4267)
To build the project I use msbuild 15.2.0.0 that comes with Xamarin.
On the terminal I change my directory to cd /SonarQubeXamarinDemo/SonarQube and run the following commands.
mono /Users/christopher/Downloads/sonar-scanner-msbuild-4.0.1.883/MSBuild.SonarQube.Runner.exe begin /k:"test" /d:sonar.host.url="http://localhost:9000" /d:sonar.login="***"
Default properties file was found at /Users/christopher/Downloads/sonar-scanner-msbuild-4.0.1.883/SonarQube.Analysis.xml
Loading analysis properties from /Users/christopher/Downloads/sonar-scanner-msbuild-4.0.1.883/SonarQube.Analysis.xml
Pre-processing started.
Preparing working directories...
15:14:24.778 Updating build integration targets...
15:14:24.796 Fetching analysis configuration settings...
15:14:25.164 Provisioning analyzer assemblies for cs...
15:14:25.165 Installing required Roslyn analyzers...
15:14:25.225 Pre-processing succeeded.
msbuild /t:Rebuild
...
mono /Users/christopher/Downloads/sonar-scanner-msbuild-4.0.1.883/MSBuild.SonarQube.Runner.exe end
SonarQube Scanner for MSBuild 4.0.1
Default properties file was found at /Users/christopher/Downloads/sonar-scanner-msbuild-4.0.1.883/SonarQube.Analysis.xml
Loading analysis properties from /Users/christopher/Downloads/sonar-scanner-msbuild-4.0.1.883/SonarQube.Analysis.xml
Post-processing started.
SONAR_SCANNER_OPTS is not configured. Setting it to the default value of -Xmx1024m
Calling the SonarQube Scanner...
INFO: Scanner configuration file: /Users/christopher/Downloads/sonar-scanner-msbuild-4.0.1.883/sonar-scanner-3.0.3.778/conf/sonar-scanner.properties
INFO: Project root configuration file: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/.sonarqube/out/sonar-project.properties
INFO: SonarQube Scanner 3.0.3.778
INFO: Java 1.8.0_91 Oracle Corporation (64-bit)
INFO: Mac OS X 10.12.6 x86_64
INFO: SONAR_SCANNER_OPTS=-Xmx1024m
INFO: User cache: /Users/christopher/.sonar/cache
INFO: Publish mode
INFO: Load global settings
INFO: Load global settings (done) | time=92ms
INFO: Server id: AWBqDLDnW0cFaKeFAIpa
INFO: User cache: /Users/christopher/.sonar/cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=47ms
INFO: SonarQube server 6.7.0
INFO: Default locale: "de_DE", source code encoding: "UTF-8" (analysis is platform dependent)
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=104ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=28ms
INFO: Load active rules
INFO: Load active rules (done) | time=418ms
INFO: Load metrics repository
INFO: Load metrics repository (done) | time=21ms
INFO: Project key: test
INFO: ------------- Scan SonarQube.iOS
INFO: Load server rules
INFO: Load server rules (done) | time=116ms
INFO: Base dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/iOS
INFO: Working dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/.sonarqube/out/.sonar/test_test_6E8E4F09-4D51-490F-A002-4E844C8CEC18
INFO: Source encoding: UTF-8, default locale: de_DE
INFO: Index files
INFO: 0 files indexed
INFO: Sensor SonarJavaXmlFileSensor [java]
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=0ms
INFO: Sensor Analyzer for "php.ini" files [php]
INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=3ms
INFO: ------------- Scan SonarQube.Droid
INFO: Base dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/Droid
INFO: Working dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/.sonarqube/out/.sonar/test_test_E9EA7651-B0E9-4DAD-9256-A858860C4022
INFO: Source encoding: UTF-8, default locale: de_DE
INFO: Index files
INFO: 0 files indexed
INFO: Sensor SonarJavaXmlFileSensor [java]
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=0ms
INFO: Sensor Analyzer for "php.ini" files [php]
INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=1ms
INFO: ------------- Scan SonarQube
INFO: Base dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/SonarQube
INFO: Working dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/.sonarqube/out/.sonar/test_test_9200C6D4-CA74-49DD-910F-6DAF012CCCDF
INFO: Source encoding: UTF-8, default locale: de_DE
INFO: Index files
INFO: 0 files indexed
INFO: Sensor SonarJavaXmlFileSensor [java]
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=1ms
INFO: Sensor Analyzer for "php.ini" files [php]
INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=0ms
INFO: ------------- Scan test
INFO: Base dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube
INFO: Working dir: /Users/christopher/Documents/SonarQubeXamarinDemo/SonarQube/.sonarqube/out/.sonar
INFO: Source paths: SonarQube/SonarQube.cs, SonarQube/Properties/AssemblyInfo.cs, SonarQube/packages.config, iOS/Main.cs, iOS/AppDelegate.cs, iOS/Info.plist, iOS/Entitlements.plist, iOS/packages.config, Droid/MainActivity.cs, Droid/Resources/Resource.designer.cs, Droid/Properties/AssemblyInfo.cs, Droid/Resources/AboutResources.txt, Droid/Properties/AndroidManifest.xml, Droid/Assets/AboutAssets.txt, Droid/packages.config
INFO: Source encoding: UTF-8, default locale: de_DE
INFO: Index files
INFO: 15 files indexed
INFO: Quality profile for cs: Sonar way
INFO: Quality profile for xml: Sonar way
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=0ms
INFO: Sensor SonarJavaXmlFileSensor [java]
WARNING: WARN: Property missing: 'sonar.cs.analyzer.projectOutPaths'. No protobuf files will be loaded for this project.
WARNING: WARN: No roslyn issues report not found for this project.
INFO: 1 source files to be analyzed
INFO: Sensor SonarJavaXmlFileSensor [java] (done) | time=62ms
INFO: 1/1 source files have been analyzed
INFO: Sensor XML Sensor [xml]
INFO: Sensor XML Sensor [xml] (done) | time=211ms
INFO: Sensor Analyzer for "php.ini" files [php]
INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=0ms
INFO: Sensor C# [csharp]
INFO: Sensor C# [csharp] (done) | time=0ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=11ms
INFO: Sensor CPD Block Indexer
INFO: Sensor CPD Block Indexer (done) | time=0ms
INFO: SCM provider for this project is: git
INFO: 8 files to be analyzed
INFO: 0/8 files analyzed
WARNING: WARN: Missing blame information for the following files:
WARNING: WARN: * Droid/MainActivity.cs
WARNING: WARN: * Droid/Properties/AndroidManifest.xml
WARNING: WARN: * Droid/Properties/AssemblyInfo.cs
WARNING: WARN: * Droid/Resources/Resource.designer.cs
WARNING: WARN: * SonarQube/Properties/AssemblyInfo.cs
WARNING: WARN: * SonarQube/SonarQube.cs
WARNING: WARN: * iOS/AppDelegate.cs
WARNING: WARN: * iOS/Main.cs
WARNING: WARN: This may lead to missing/broken features in SonarQube
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 99ms, dir size=216 KB
INFO: Analysis reports compressed in 19ms, zip size=37 KB
INFO: Analysis report uploaded in 48ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/test
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=AWBvIYbsCU-ClqGI-H2t
INFO: Task total time: 3.392 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 4.593s
INFO: Final Memory: 49M/401M
INFO: ------------------------------------------------------------------------
The SonarQube Scanner has finished
15:15:56.62 Creating a summary markdown file...
15:15:56.627 Analysis results: http://localhost:9000/dashboard/index/test
15:15:56.628 Post-processing succeeded.
The report does not show any detected issues:
I noticed these warnings but do not know if they are relevant for the undetected code issues:
WARNING: WARN: Property missing: 'sonar.cs.analyzer.projectOutPaths'. No protobuf files will be loaded for this project.
WARNING: WARN: No roslyn issues report not found for this project.
What I tried so far to fix the issue without succeeding
setting the language to C# using /d:sonar.language=cs
I was facing the same issue. so I changed the approach as below:
sonar-scanner-msbuild-4.0.1.883\SonarQube.Scanner.MSBuild.exe begin /k:FAM
dotnet restore
dotnet build
sonar-scanner-msbuild-4.0.1.883\SonarQube.Scanner.MSBuild.exe end
So instead of using msbuild.exe you can use dotnet cli commands.

Sonarqube scanner cannot resolve relative file path in PHPUnit coverage XML file

When executing sonar-scanner with the example project available at:
https://github.com/SonarSource/sonar-examples/tree/b0ebd45081e58c3cb7c660287d5ed7fb9c64bb17/projects/languages/php/php-sonar-runner-unit-tests
I get the following warning, and the coverage data is not sent to the Sonar host:
WARN: Could not resolve 1 file paths in phpunit.coverage.xml, first unresolved path: src/Math.php
Full output of command:
root#46e4a60694f9:/home/test/sonar-examples-master/projects/languages/php/php-sonar-runner-unit-tests# /home/sonar-scanner-2.8/bin/sonar-scanner
INFO: Scanner configuration file: /home/sonar-scanner-2.8/conf/sonar-scanner.properties
INFO: Project root configuration file: /home/test/sonar-examples-master/projects/languages/php/php-sonar-runner-unit-tests/sonar-project.properties
INFO: SonarQube Scanner 2.8
INFO: Java 1.8.0_111 Oracle Corporation (64-bit)
INFO: Linux 4.4.27-boot2docker amd64
INFO: User cache: /root/.sonar/cache
INFO: Load global repositories
INFO: Load global repositories (done) | time=240ms
INFO: User cache: /root/.sonar/cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=24ms
INFO: SonarQube server 6.1
INFO: Default locale: "en", source code encoding: "UTF-8"
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=141ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=55ms
INFO: Load active rules
INFO: Load active rules (done) | time=141ms
WARN: SCM provider autodetection failed. No SCM provider claims to support this project. Please use sonar.scm.provider to define SCM of your project.
INFO: Publish mode
INFO: ------------- Scan PHP :: PHPUnit :: SonarQube Scanner
INFO: Language is forced to php
INFO: Load server rules
INFO: Load server rules (done) | time=76ms
INFO: Base dir: /home/test/sonar-examples-master/projects/languages/php/php-sonar-runner-unit-tests
INFO: Working dir: /home/test/sonar-examples-master/projects/languages/php/php-sonar-runner-unit-tests/.sonar
INFO: Source paths: src
INFO: Test paths: tests
INFO: Source encoding: UTF-8, default locale: en
INFO: Index files
INFO: 3 files indexed
INFO: Quality profile for php: Sonar way
INFO: Sensor Lines Sensor
INFO: Sensor Lines Sensor (done) | time=25ms
INFO: Sensor NoSonar Sensor
INFO: Sensor NoSonar Sensor (done) | time=65ms
INFO: Sensor SCM Sensor
INFO: No SCM system was detected. You can use the 'sonar.scm.provider' property to explicitly specify it.
INFO: Sensor SCM Sensor (done) | time=0ms
INFO: Sensor PHP sensor
INFO: 2 source files to be analyzed
INFO: 2/2 source files have been analyzed
INFO: Analyzing PHPUnit test report: reports/phpunit.xml with org.sonar.plugins.php.phpunit.PhpUnitResultParser#31ddd4a4
INFO: Analyzing PHPUnit unit test coverage report: reports/phpunit.coverage.xml with PHPUnit Unit Test Coverage Result Parser
WARN: Could not resolve 1 file paths in phpunit.coverage.xml, first unresolved path: src/Math.php
INFO: No PHPUnit integration test coverage report provided (see 'sonar.php.coverage.itReportPath' property)
INFO: No PHPUnit overall coverage report provided (see 'sonar.php.coverage.overallReportPath' property)
INFO: Sensor PHP sensor (done) | time=1419ms
INFO: Sensor Analyzer for "php.ini" files
INFO: Sensor Analyzer for "php.ini" files (done) | time=11ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=49ms
INFO: Sensor Code Colorizer Sensor
INFO: Sensor Code Colorizer Sensor (done) | time=1ms
INFO: Sensor CPD Block Indexer
INFO: DefaultCpdBlockIndexer is used for php
INFO: Sensor CPD Block Indexer (done) | time=2ms
INFO: Calculating CPD for 2 files
INFO: CPD calculation finished
INFO: Analysis report generated in 96ms, dir size=27 KB
INFO: Analysis reports compressed in 18ms, zip size=13 KB
INFO: Analysis report uploaded in 115ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://***.elasticbeanstalk.com/dashboard/index/org.sonarqube:php-ut-sq-scanner
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://***.elasticbeanstalk.com/api/ce/task?id=AVhaEXKjVjsdBlz4sGdU
INFO: Task total time: 3.511 s
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 5.098s
INFO: Final Memory: 42M/149M
INFO: ------------------------------------------------------------------------
When I change the path to absolute in the phpunit.coverage.xml, it seems to be working in Linux. On Windows docker quick start terminal (MINGW64) the only way to make it work is by using windows-style absolute paths:
C:\Users\username\projects\php-sonar-runner-unit-tests
Is there any way to make it work with relative paths?
Quoting from the README (on the same page that you linked):
In "reports/phpunit.coverage.xml", change the path "src/Math.php" to the full path of this file on your machine.
You must use the absolute path. It doesn't work with relative paths.
Note that this is just an example coverage report file, using one pre-generated by PHPUnit (also mentioned in the README). Normally you generate the coverage report file yourself before running SonarQube analysis, in which case it will have the correct absolute path in your system.

SonarQube: No analysis retrieved

I tried to run a project.
The execution was successful but there seems to not have any analysis.
The log from the command prompt is as follow:
C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-2.6.1\bin>sonar-scanner.bat
C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-2.6.1\bin\..
INFO: Scanner configuration file: C:\Users\kong-yong.tay\Desktop\Sonar\sonar-sca
nner-2.6.1\bin\..\conf\sonar-scanner.properties
INFO: Project root configuration file: NONE
INFO: SonarQube Scanner 2.6.1
INFO: Java 1.8.0_102 Oracle Corporation (64-bit)
INFO: Windows 7 6.1 amd64
INFO: User cache: C:\Users\kong-yong.tay\.sonar\cache
INFO: Load global repositories
INFO: Load global repositories (done) | time=167ms
WARN: Property 'sonar.jdbc.url' is not supported any more. It will be ignored. T
here is no longer any DB connection to the SQ database.
INFO: User cache: C:\Users\kong-yong.tay\.sonar\cache
INFO: Load plugins index
INFO: Load plugins index (done) | time=11ms
INFO: SonarQube server 5.6
INFO: Default locale: "en_US", source code encoding: "UTF-8"
INFO: Process project properties
INFO: Load project repositories
INFO: Load project repositories (done) | time=173ms
INFO: Load quality profiles
INFO: Load quality profiles (done) | time=87ms
INFO: Load active rules
INFO: Load active rules (done) | time=569ms
WARN: SCM provider autodetection failed. No SCM provider claims to support this
project. Please use sonar.scm.provider to define SCM of your project.
INFO: Publish mode
INFO: ------------- Scan Javascript Sonar Runner Simple
INFO: Language is forced to js
INFO: Load server rules
INFO: Load server rules (done) | time=325ms
INFO: Base dir: C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-2.6.1\bin
INFO: Working dir: C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-2.6.1\bin\
.sonar
INFO: Source paths: C:\Users\kong-yong.tay\Desktop\Sonar\sonar-examples-master\p
rojects\languages\javascript\javascript-sonar-runner\src
INFO: Source encoding: UTF-8, default locale: en_US
INFO: Index files
WARN: File 'C:\Users\kong-yong.tay\Desktop\Sonar\sonar-examples-master\projects\
languages\javascript\javascript-sonar-runner\src\Person.js' is ignored. It is no
t located in module basedir 'C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-
2.6.1\bin'.
INFO: 0 files indexed
INFO: Quality profile for js: Sonar way
INFO: JaCoCoSensor: JaCoCo report not found : C:\Users\kong-yong.tay\Desktop\Son
ar\sonar-scanner-2.6.1\bin\target\jacoco.exec
INFO: JaCoCoItSensor: JaCoCo IT report not found: C:\Users\kong-yong.tay\Desktop
\Sonar\sonar-scanner-2.6.1\bin\target\jacoco-it.exec
INFO: Sensor Lines Sensor
INFO: Sensor Lines Sensor (done) | time=0ms
INFO: Sensor SCM Sensor
INFO: No SCM system was detected. You can use the 'sonar.scm.provider' property
to explicitly specify it.
INFO: Sensor SCM Sensor (done) | time=2ms
INFO: Sensor Zero Coverage Sensor
INFO: Sensor Zero Coverage Sensor (done) | time=0ms
INFO: Sensor Code Colorizer Sensor
INFO: Sensor Code Colorizer Sensor (done) | time=0ms
INFO: Sensor CPD Block Indexer
INFO: DefaultCpdBlockIndexer is used for js
INFO: Sensor CPD Block Indexer (done) | time=1ms
INFO: Calculating CPD for 0 files
INFO: CPD calculation finished
INFO: Analysis report generated in 72ms, dir size=11 KB
INFO: Analysis reports compressed in 14ms, zip size=4 KB
INFO: Analysis report uploaded in 86ms
INFO: ANALYSIS SUCCESSFUL, you can browse http://localhost:9000/dashboard/index/
org.sonarqube:java-simple-sq-scanner
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=A
VZ3vdRUAtopFvSq_-I1
INFO: ------------------------------------------------------------------------
INFO: EXECUTION SUCCESS
INFO: ------------------------------------------------------------------------
INFO: Total time: 4.071s
INFO: Final Memory: 47M/180M
INFO: ------------------------------------------------------------------------
It ran the first time (though without any analysis results but there was a log recorded in the database). However, for the subsequent time that I've ran the test, it has already stopped the connection to the database.
Please help.
You should run SonarQube Scanner in the directory where your project is located, not from where the Scanner is stored. In short (and in your case):
> cd C:\Users\kong-yong.tay\Desktop\Sonar\sonar-examples-master\projects\languages\javascript\javascript-sonar-runner
> C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-2.6.1\bin\sonar-scanner.bat
Current situation
Currently you run it from:
INFO: Working dir: C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-2.6.1\bin\
But your code is in:
INFO: Source paths: C:\Users\kong-yong.tay\Desktop\Sonar\sonar-examples-master\projects\languages\javascript\javascript-sonar-runner\src
And since you did not explicitely set sonar.projectBaseDir (see Analysis Parameters), you end up with this warning:
WARN: File 'C:\Users\kong-yong.tay\Desktop\Sonar\sonar-examples-master\projects\
languages\javascript\javascript-sonar-runner\src\Person.js' is ignored. It is no
t located in module basedir 'C:\Users\kong-yong.tay\Desktop\Sonar\sonar-scanner-
2.6.1\bin'.
INFO: 0 files indexed

Resources