"Line Of Code" IS CHANGING

“Line Of Codes” is constantly changing every time I get a build.Can you help on the subject?

I am running following codes

  • SonarScanner.MSBuild.exe begin /k:“Peak.App.Service.Cek” /n:“Peak.App.Service.Cek” /d:sonar.cs.opencover.reportsPaths=“D:\TFS\tfssetup\UMP.Cek Senet\Code\Peak\App\Service\Peak.App.Service.Cek\coverage.xml” /d:sonar.cs.xunit.reportsPaths=“D:\TFS\tfssetup\UMP.Cek Senet\Code\Peak\App\Service\Peak.App.Service.Cek\test-result.xml” /d:sonar.tests=“D:\TFS\tfssetup\UMP.Cek Senet\Code\Peak\Test\Peak.Test.Service.Cek” /d:sonar.scm.provider=tfvc /d:sonar.sourceEncoding=UTF-8

  • “C:\Program Files (x86)\MSBuild\14.0\Bin\MSBuild.exe” Peak.App.Service.Cek.csproj /t:rebuild

  • AltCover.exe -i “D:\TFS\tfssetup\UMP.Cek Senet\Code\Peak\Test\Peak.Test.Service.Cek\bin\Debug” -l -o altcover

  • AltCover.exe Runner -x xunit.console.exe -w . -r altcover\ – altcover\Peak.Test.Service.Cek.dll -xml test-result.xml

  • SonarScanner.MSBuild.exe end

Hey there.

Are the numbers only changing in the context of Coverage, or also overall size (in the list of metrics to represent on the activity graph, choose Custom > Lines of Code

Hi Colin,

First of all, thank you for your answer.It is changing as overall.(I added graph)

Thank You,
Best Regards.

Thanks!

That does look odd. Normally we would suggest that this is the result of not doing a clean/full build, but we can see in your MSBuild command that /t:rebuild is specified.

  • Is it possible that somebody else is targeting the same project key but could be using different commands than you?
  • Are you always targeting the same project (.csproj) with your MSBuild command?

If you are able to manually execute two builds that produce different results (and have the logs of both), my next recommendation would be to do a diff on the logs (even using a tool like https://www.diffchecker.com/) and understand would could be different (besides the timestamps)

Hi,
I am running same commands.I looked logs.But I didnt find meaningful data.Could you please look logs.I added 140.000 log and 75.000 log.

75000Lineslog.txt (2.9 MB)
140.000lineslog.txt (7.0 MB)

Thank You,
Best Regards.

Hi,

Also I see missing codes when I build application.I sometimes see all application codes.

Thank You,
Best Regards

Hi @Colin ,

Could u look problem

Thank You ,
Best Regards.

Hey there.

It looks like the build of some of the projects is simply failing in the build/analysis that produces lower LoC.

Done Building Project "D:\TFS\tfssetup\UMP.€ek Senet\Code\Peak\App\Service\Peak.App.Service.Cek\Peak.App.Service.Cek.csproj" (rebuild target(s)) -- FAILED.

You’ll need to make sure the build is consistently building all applications (and probably failing the build if its not)