PHP sonarqube is not fetching cobertura coverage report

I am generating cobertura.cml through bash script pipeline task in Azure Devops
And trying publish code coverage using cobertura and a artifact is creating showing a certain percentage

I when I tried to integrate to sonarqube it’s says coverage report does not contain any record in the file cc.xml

I have added the following in sonar.extra properties
Sonar.sources =.
Sonarqube.php.coverage.reportPaths=cobertura.xml
sonar.language=php
Sonar.verbose=true

How to debug and fix the issue…pl suggest

A good first step is making sure you’re using the right analysis parameter, sonar.php.coverage.reportPaths.

Hi Colin ,Thanks for the reply …

Yes I am following the same, apologies had type error in the initial post

I am using like this additional property of Prepare Analysis on Sonarqube task

sonar.sources = .
sonar.php.coverage.reportPaths=cobertura.xml
sonar.language=php
sonar.verbose=true

In sonarqube logs it’s tries to import the file and next line shows

Coverage Report does not contain any record in file cobertura.xml

if you run a cat cobertura.xml, do you see the expected coverage data? SonarQube just reads the report it’s given. If the report is flawed… you aren’t going to get any coverage data.

Yup…when I run cat cobertura.xml i can see the content below …I am pasting first two lines

<?xml version="1.0" encoding="UTF-8"?>

</coverage line-rate=“0.02353497219708”
branch-rate=“0” lines-covered=“182” lines-valid=“7733” branches-covered=“0” branches-valid=“0” complexity=“1776” version=“0.4” timestamp=“1728499099”/>

/opt/AzureDevops/myagent/work/16/s/src/app

Content seems okay …but still it shows report s does not have any valid record …while importing coverage report

And a artifact is creating for cobertura in azure DevOps a index.html is created which has a html of percentage with covered and uncovered lines in the code…

Followed by cobertura.xml…i can able to see the content…

Still confused …where the issue the happening

How about instead of describing the logs, you share the full analysis log where you get this message?