Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Line 1203 is out of range when scanning C# file

Tags:

c#

sonarqube

We have a quite large code base, and one of the projects breaks the SonarQube analysis with the following error.

016-12-15T11:20:30.8989361Z ##[error]ERROR: Error during SonarQube Scanner execution 
2016-12-15T11:20:30.8999277Z ##[error]java.lang.IllegalStateException: Line 1203 is out of range in the file Converters/IMSServiceToESBConverter.cs (lines: 1202)

We are using SonarQube 6.1 and the latest C# plugin (5.5.1.522).

Disabling all rules in the C# profile still causes this problem.

like image 457
Kristian Leonhard Avatar asked Dec 15 '16 11:12

Kristian Leonhard


1 Answers

I also encountered the similar issue while running SonarQube with JaCoCo Code Coverage Reports for Java code:

ERROR: Error during SonarQube Scanner execution
java.lang.IllegalStateException: Line [..] is out of range in the file [..]

The problem was due to the old code coverage report that was generated before updating the code. It was fixed after generating coverage reports again. So, please also make sure that the any coverage reports that are left behind from the previous run are cleared and new coverage reports are in place.

like image 180
user1014639 Avatar answered Sep 18 '22 13:09

user1014639