Pull Request code changed not same that is really modified

Hello,
we are using SonarQube Developer Edition 7.7 and it works pretty well the Pull Request quality check. On our .NET project we found an issue on code that was recognized like new code vs the one that is already impacted from the Pull Request.

I have modified one line of code, but SonarQube quality check report that the full file is modified, and break the quality gates because looks that there is some code duplicated.

I have tried also to enable debugging information to Full, to check if the code is well compared (to verify the new one) but nothing change.

Thanks for the help

Here some information on my SonarQube Scanner for MSBuild

2019-07-09T07:05:21.0540045Z ##[section]Starting: Run Code Analysis
2019-07-09T07:05:21.0545361Z ==============================================================================
2019-07-09T07:05:21.0545460Z Task         : Run Code Analysis
2019-07-09T07:05:21.0545516Z Description  : Run scanner and upload the results to the SonarQube server.
2019-07-09T07:05:21.0545581Z Version      : 4.6.3
2019-07-09T07:05:21.0545627Z Author       : sonarsource
2019-07-09T07:05:21.0545705Z Help         : This task is not needed for Maven and Gradle projects since the scanner should be run as part of the build.

[More Information](http://redirect.sonarsource.com/doc/install-configure-scanner-tfs-ts.html)
2019-07-09T07:05:21.0545792Z ==============================================================================
2019-07-09T07:05:21.3559756Z [command]C:\Agent2\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.6.3\classic-sonar-scanner-msbuild\SonarScanner.MSBuild.exe end
2019-07-09T07:05:21.4510214Z SonarScanner for MSBuild 4.6.2
2019-07-09T07:05:21.4516600Z Using the .NET Framework version of the Scanner for MSBuild
2019-07-09T07:05:21.4986108Z Post-processing started.
2019-07-09T07:05:21.6368136Z 09:05:21.627  Fetching code coverage report information from TFS...
2019-07-09T07:05:21.6385739Z 09:05:21.627  Attempting to locate a test results (.trx) file...
2019-07-09T07:05:21.9036866Z 09:05:21.892  Looking for TRX files in: C:\Agent2\_work\273\TestResults, C:\Agent2\_work\273\s\TestResults
2019-07-09T07:05:21.9037638Z 09:05:21.892  The following test results files were found: C:\Agent2\_work\273\s\TestResults\ITS-TFS-Svc_GDC01753_2019-07-09_09_01_05.trx
2019-07-09T07:05:22.1709558Z 09:05:22.158  The following code coverage attachments were found from the trx files: C:\Agent2\_work\273\s\TestResults\ITS-TFS-Svc_GDC01753_2019-07-09_09_01_05\In\GDC01753\ITS-TFS-Svc_GDC01753 2019-07-09 09_00_59.coverage
2019-07-09T07:05:24.1628420Z WARNING: File 'C:\Users\ITS-TFS-Svc\AppData\Local\Temp\.NETFramework,Version=v4.5.SqlClrAttributes.cs' is not located under the root directory 'C:\Agent2\_work\273\s' and will not be analyzed.
2019-07-09T07:05:24.2175969Z WARNING: File 'C:\Agent2\_work\273\s\Rmis.Rest.Services\Properties\PublishProfiles\DEV.pubxml' does not exist.
2019-07-09T07:05:24.2176304Z WARNING: File 'C:\Agent2\_work\273\s\Rmis.Rest.Services\Properties\PublishProfiles\PROD.pubxml' does not exist.
2019-07-09T07:05:24.2176673Z WARNING: File 'C:\Agent2\_work\273\s\Rmis.Rest.Services\Properties\PublishProfiles\REST Service DEV.pubxml' does not exist.
2019-07-09T07:05:24.2177105Z WARNING: File 'C:\Agent2\_work\273\s\Rmis.Rest.Services\Properties\PublishProfiles\REST Service PROD.pubxml' does not exist.
2019-07-09T07:05:24.2548565Z Calling the SonarQube Scanner...
2019-07-09T07:05:24.5056823Z INFO: Scanner configuration file: C:\Agent2\_work\_tasks\SonarQubePrepare_15b84ca1-b62f-4a2a-a403-89b77a063157\4.6.3\classic-sonar-scanner-msbuild\sonar-scanner-3.3.0.1492\bin\..\conf\sonar-scanner.properties
2019-07-09T07:05:24.5068673Z INFO: Project root configuration file: C:\Agent2\_work\273\.sonarqube\out\sonar-project.properties
2019-07-09T07:05:24.5568499Z INFO: SonarQube Scanner 3.3.0.1492
2019-07-09T07:05:24.5568732Z INFO: Java 1.8.0_181 Oracle Corporation (64-bit)
2019-07-09T07:05:24.5569086Z INFO: Windows Server 2012 R2 6.3 amd64
2019-07-09T07:05:24.8774281Z INFO: User cache: C:\Users\ITS-TFS-Svc\.sonar\cache
2019-07-09T07:05:24.9688689Z INFO: SonarQube server 7.7.0
2019-07-09T07:05:24.9690938Z INFO: Default locale: "en_US", source code encoding: "windows-1252" (analysis is platform dependent)
2019-07-09T07:05:25.2997993Z INFO: Load global settings

I have solved adding this powershell script to my pipeline

git config --global core.autocrlf false

2 Likes