Lines of code exceed the limit

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube Server / Community Build, Scanner, Plugin, and any relevant extension):- Enterprise Edition v2025.1 (102418)

  • how is SonarQube deployed: zip

  • what are you trying to achieve:- Running out of line

  • what have you tried so far to achieve this:- Try to exclude projects with in Soanr Prepare analysis

We are using Sonar Qube on Priem Enterprise with ADO pipeline. Currently most of our repos consists of multiple projects. And all those projects have multiple pipeline to publish the coverage on Sonar Qube for each of them. I have added the projects which are not referenced by current solution and passed as excluded projects. But the number of line of code for the projects is still more than 200k. I have tried deleting the sonar qube project and do a fresh analysis even after adding the exclusion. There is no change in number of line of code. Can you please suggest the solution?

Thanks

Sunil Bindra

Do not share screenshots of logs – share the text itself (bonus points for being well-formatted)!

Hey @sunil.bindra, so if I understand correctly you are trying to exclude subprojects within a project/repository, right? Could you let me know what’s one of the subprojects that you’re trying to exclude and what is the value of sonar.exclusions/sonar.test.exclusions that you’re using to exclude it? Feel free to attach screenshots if it makes it easier to show it.

Hi Andres

This is our repo is

And in one of our pipeline we are only building the solution which is under “Bluebay.pi.ui”, and here is what I am passing as exclusions “/AssemblyInfo.cs, /*.xml,Test.cs,/*.bin,./BlueBay.Pi.Controls/,./BlueBay.Pi.DataFeeds/,./BlueBay.Pi.Excel/,./BlueBay.Pi.Lib/,./BlueBay.Pi.OpenAccess/,./BlueBay.Pi.Permissions.Service/,./BlueBay.Pi.QAAutomation/,./BlueBay.Pi.Service/,./BlueBay.Pi.SignalR.Service/,./BlueBay.Pi.Tools/,./BlueBay.PiCo.Lib/,./BlueBay.PiCo.Service/,./BlueBay.PiCoCache/,./BlueBay.PositionBuilder/,./BlueBay.Snapshot.Service/,./BlueBay.Tqs.WebApi/,./BlueBay.Tqs/,./BlueBay.TradeCalibrationService/,./Database/,./Tools/,./assets/*”

Here is the properties in our Prepare Analysis task:-

in SoarQube it shows the coverage for the folders suppose to be excluded:-

Thanks

Sunil Bindra

Hey @sunil.bindra, okay, let’s see: the 1st file in the screenshot from SonarQube is BlueBay.Tqs/CustomQueryService.Db/Scripts/01 - CustomQueryService Schema Baseline.sql. In the long list of exclusion patterns you sent, none of them matches this file. However, one of them is quite close: /BlueBay.Tqs/, but this alone won’t match it. This would only match a file with that exact same name. If, instead, you wrote it as /BlueBay.Tqs/**, then it would match any path that begins with /BlueBay.Tqs/, including files and nested dirs inside. I think this is the type of exclusion that you want.

Generalizing, I think you’re missing ** after most of your exclusion patterns. Most of them are simply the name of a directory. You can check out our docs on wildcard pattern matching.