I am using the SonarLint plugin for VS code with bindings to our own Sonarqube instance.
We have a bunch of old, long-grown files which unfortunately exceed our rules for max line length per file, max line length per function, and max function complexity.
This leads to very ugly renderings of those files / functions due to everything being underlined from the first character position to the last.
(If it’s not clear from the obsfuscated source code, hopefully the minimap should give it away.)
The number of characters to be underlined seems to come from the Sonarlint plugin:
{
"resource": "/path/to/file.js",
"owner": "sonarlint",
"code": "javascript:S138",
"severity": 4,
"message": "function has too many lines (2293). Maximum allowed is 200.",
"source": "sonarlint",
"startLineNumber": 1,
"startColumn": 8,
"endLineNumber": 3023,
"endColumn": 2
}
Please note the huge endLineNumber
value (3023). Would it be possible to decrease this value for this issue and similar ones? E.g. the warning only spans a few lines or only the function name?
Of course did I try to change the errorWarning.foreground
color or just mute the whole underline / warning output in the VS Code settings. But I think this misses the point. I still should be (and want to be) made aware of the issue. to one day refactor for less length and complexity. However, it will not happen sooner when the whole code becomes harder to read, and I am probably even missing graver issues somewhere in this yellow-curled nightmare.
What do you think?
Extension
Name: SonarLint
Id: sonarsource.sonarlint-vscode
Description: SonarLint is an IDE extension that helps you detect and fix quality issues as you write code in JavaScript, TypeScript, Python and PHP.
Version: 1.13.0
Publisher: SonarSource
VS Marketplace Link: https://marketplace.visualstudio.com/items?itemName=SonarSource.sonarlint-vscode
VS Code
Version: 1.41.1
Commit: 26076a4de974ead31f97692a0d32f90d735645c0
Date: 2019-12-18T15:04:31.999Z
Electron: 6.1.5
Chrome: 76.0.3809.146
Node.js: 12.4.0
V8: 7.6.303.31-electron.0
OS: Linux x64 4.19.91-1-MANJARO