Coverage in Sonarqube is Still 0%

@Quentin @Colin

Hi, All
I run the scanner with this command :
./sonar-scanner/bin/sonar-scanner -Dsonar.scm.disabled=True -Dsonar.projectKey=api-orders -Dsonar.projectBaseDir=/home/ec2-user/api-orders -Dproject.settings=/sonar-scanner/conf/sonar-scanner.properties -Dsonar.php.coverage.reportPaths=/home/ec2-user/api-orders/_reports/coverage.xml -Dsonar.php.tests.reportPath=/home/ec2-user/api-orders/_reports/junit-logfile.xml -Dsonar.exclusions=file:/home/ec2-user/api-orders/tests/,file:/home/ec2-user/api-orders/qa_test/

The coverage is still 0. Please help me to find out what’s the problem

Here is the log :

INFO: Scanner configuration file: /home/ec2-user/sonar-scanner/conf/sonar-scanner.properties

INFO: Project root configuration file: NONE

INFO: SonarQube Scanner 4.0.0.1744

INFO: Java 11.0.3 AdoptOpenJDK (64-bit)

INFO: Linux 4.14.138-114.102.amzn2.x86_64 amd64

INFO: User cache: /home/ec2-user/.sonar/cache

INFO: SonarQube server 7.9.1

INFO: Default locale: "en_US", source code encoding: "UTF-8"

INFO: Load global settings

INFO: Load global settings (done) | time=174ms

INFO: Server id: FECAD177-AW3yS8iN_q5u-Fml-omt

INFO: User cache: /home/ec2-user/.sonar/cache

INFO: Load/download plugins

INFO: Load plugins index

INFO: Load plugins index (done) | time=62ms

INFO: Load/download plugins (done) | time=184ms

INFO: Process project properties

INFO: Execute project builders

INFO: Execute project builders (done) | time=6ms

INFO: Project key: api-orders

INFO: Base dir: /home/ec2-user/api-orders

INFO: Working dir: /home/ec2-user/api-orders/.scannerwork

INFO: Load project settings for component key: 'api-orders'

INFO: Load project settings for component key: 'api-orders' (done) | time=23ms

INFO: Load quality profiles

INFO: Load quality profiles (done) | time=51ms

INFO: Load active rules

INFO: Load active rules (done) | time=733ms

WARN: Using absolute path pattern is deprecated. Please use relative path instead of 'file:/home/ec2-user/api-orders/tests/**'

WARN: Using absolute path pattern is deprecated. Please use relative path instead of 'file:/home/ec2-user/api-orders/qa_test/**'

INFO: Indexing files...

INFO: Project configuration:

INFO: Excluded sources: file:/home/ec2-user/api-orders/tests/**, file:/home/ec2-user/api-orders/qa_test/**

WARN: Using absolute path pattern is deprecated. Please use relative path instead of 'file:/home/ec2-user/api-orders/tests/**'

WARN: Using absolute path pattern is deprecated. Please use relative path instead of 'file:/home/ec2-user/api-orders/qa_test/**'

INFO: Load project repositories

INFO: Load project repositories (done) | time=47ms

WARN: Invalid character encountered in file /home/ec2-user/api-orders/public/swagger-ui-assets/swagger-ui-bundle.js at line 71 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 /home/ec2-user/api-orders/public/swagger-ui-assets/swagger-ui-standalone-preset.js at line 13 for encoding UTF-8. Please fix file content or configure the encoding to be used using property 'sonar.sourceEncoding'.

INFO: 272 files indexed

INFO: 0 files ignored because of inclusion/exclusion patterns

INFO: Quality profile for php: Sonar way

INFO: Quality profile for web: Sonar way

INFO: Quality profile for xml: Sonar way

INFO: ------------- Run sensors on module api-orders

INFO: Load metrics repository

INFO: Load metrics repository (done) | time=37ms

WARNING: An illegal reflective access operation has occurred

WARNING: Illegal reflective access by net.sf.cglib.core.ReflectUtils$1 (file:/home/ec2-user/.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 JaCoCo XML Report Importer [jacoco]

INFO: Sensor JaCoCo XML Report Importer [jacoco] (done) | time=6ms

INFO: Sensor JavaXmlSensor [java]

INFO: 3 source files to be analyzed

INFO: 3/3 source files have been analyzed

INFO: Sensor JavaXmlSensor [java] (done) | time=1045ms

INFO: Sensor HTML [web]

INFO: Sensor HTML [web] (done) | time=706ms

INFO: Sensor XML Sensor [xml]

INFO: 3 source files to be analyzed

INFO: Sensor XML Sensor [xml] (done) | time=946ms

INFO: 3/3 source files have been analyzed

INFO: Sensor PHP sensor [php]

INFO: 248 source files to be analyzed

INFO: 185/248 files analyzed, current file: app/Modules/BusinessLogic/V4/Cart/QR/DeleteAllCartLogic.php

INFO: 248/248 source files have been analyzed

INFO: Analyzing PHPUnit test report: /home/ec2-user/api-orders/_reports/junit-logfile.xml

INFO: Analyzing PHPUnit coverage report: /home/ec2-user/api-orders/_reports/coverage.xml

WARN: Could not resolve 41 file paths in coverage.xml, first unresolved path: /usr/share/nginx/html/api-orders/app/Modules/BusinessLogic/V4/BusinessLogic.php

INFO: Sensor PHP sensor [php] (done) | time=15349ms

INFO: Sensor Analyzer for "php.ini" files [php]

INFO: Sensor Analyzer for "php.ini" files [php] (done) | time=8ms

INFO: ------------- Run sensors on project

INFO: Sensor Zero Coverage Sensor

INFO: Sensor Zero Coverage Sensor (done) | time=94ms

INFO: SCM Publisher is disabled

INFO: 21 files had no CPD blocks

INFO: Calculating CPD for 229 files

INFO: CPD calculation finished

INFO: Analysis report generated in 367ms, dir size=2 MB

INFO: Analysis report compressed in 710ms, zip size=889 KB

INFO: Analysis report uploaded in 159ms

INFO: ANALYSIS SUCCESSFUL, you can browse https://sonarqube.ralali.xyz/dashboard?id=api-orders

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 https://sonarqube.ralali.xyz/api/ce/task?id=AW6sJ2p1DYqnq6zZkHm6

INFO: Analysis total time: 25.955 s

INFO: ------------------------------------------------------------------------

INFO: EXECUTION SUCCESS

INFO: ------------------------------------------------------------------------

INFO: Total time: 27.869s

INFO: Final Memory: 7M/30M
INFO: ------------------------------------------------------------------------