Kristian Leonhard
Kristian Leonhard

Reputation: 91

Line 1203 is out of range when scanning C# file

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.

Upvotes: 6

Views: 5262

Answers (1)

user1014639
user1014639

Reputation: 488

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.

Upvotes: 9

Related Questions