At the moment, the source code viewer in SonarQube will only display 500 lines before showing a “Load More Code” button, allowing you to display another 500 lines.
While this is a pretty sensible default in codebases where files are limited to ~1000 lines, many codebases do have 10,000+ lines per file.
Here’s a real example of where this can be a problem:
- You have recently modified a file. This file has 16,000 lines.
- An issue is raised at the top of the file. Drat, looks like CPD has found duplicate code blocks.
- You begin scrolling through the file to find these duplicate code blocks. 500 lines later, you click “Load More Code” and keep scrolling.
- Repeat 32 times.
- Ah, there it is.
It seems there would be a couple of potential solutions here:
- Allow SonarQube administrators to update the line threshold from 500 to some other number.
- In addition to “Load More Code”, have a “Load All Code” button.