We use this in C#, but it is applicable for any language. There may be a parameter to how many empty lines in a row are accepted. This is a styling rule, which makes source code a bit more concise and nicer.
Noncompliant code
function void f1() {
int i;
i = Compute();
}
function void f2() {
...
}
Compliant Code
function void f1() {
int i;
i = Compute();
}
function void f2() {
...
}
I’m not sure if Sonar should invest time in rules like these (I use such an analyser too). There are other libs already doing so. But that is a strategic decision that is up to them.
Reimplementing this rule wouldn’t add much value and could impact the user experience. The technical debt wouldn’t make much sense if this issue can be fixed automatically in 5 minutes on the whole codebase.