SonarCloud PR Branch - 0 new lines to cover

We are using SonarCloud, we use Azure Devops with Microsoft Hosted Agents to scan our C# projects. All of a sudden when we check in new code, the pull request branch in SonarCloud isn’t seeing that there are any new lines to cover.

We can see new lines against duplication, so I would expect there to be the same amount of new lines against the lines to cover?

Here is an example of one of the pull requests:

And here is what our quality gate looks like:

What is it that determines the amount of new lines to cover for code coverage?

Thanks,
Pete

1 Like

Looking at the logs from the SonarCloud Analyse step, it looks like the CSharp sensor can only find 1 file to be analysed in our main API project:

INFO: ------------- Run sensors on module Location.API
INFO: Sensor CSS Rules [cssfamily]
INFO: No CSS, PHP, HTML or VueJS files are found in the project. CSS analysis is skipped.
INFO: Sensor CSS Rules [cssfamily] (done) | time=1ms
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=23ms
INFO: Sensor C# Project Type Information [csharp]
INFO: Sensor C# Project Type Information [csharp] (done) | time=0ms
INFO: Sensor C# Analysis Log [csharp]
INFO: Roslyn version: 3.11.0.0
INFO: Language version: CSharp8
INFO: Concurrent execution: disabled
INFO: Roslyn version: 3.11.0.0
INFO: Language version: CSharp8
INFO: Concurrent execution: disabled
INFO: Roslyn version: 3.11.0.0
INFO: Language version: CSharp8
INFO: Concurrent execution: disabled
INFO: Sensor C# Analysis Log [csharp] (done) | time=1ms
INFO: Sensor C# Properties [csharp]
INFO: Sensor C# Properties [csharp] (done) | time=1ms
INFO: Sensor JavaXmlSensor [java]
INFO: 1 source file to be analyzed
INFO: 1/1 source file has been analyzed

Is anyone able to help further with this please?

Thanks,
Pete

Hi @pconnor

Can you check what are you seeing in the Code tab ? Was there any exclusion set recently ? is is happening across all PR you create ? Which scanner are you using ?

Thanks.
Mickaël

1 Like

This topic was automatically closed after 8 days. New replies are no longer allowed.