Line 1203 is out of range when scanning C# file

人盡茶涼 提交于 2020-06-27 08:22:08

问题


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.


回答1:


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.



来源:https://stackoverflow.com/questions/41163335/line-1203-is-out-of-range-when-scanning-c-sharp-file

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!