I get the issue squid:MaximumInheritanceDepth for one of my classes.
SonarLint tells me This class has 6 parents which is greater than 5 authorized.
I looked through my class and only found 5 Parents.
So i wrote an example.
public TestClass{
public abstract class Parent1 {
int value = 0;
public int getValue() {
return value;
}
}
public abstract class Parent2 extends Parent1 {
}
public abstract class Parent3 extends Parent2 {
}
public abstract class Parent4 extends Parent3 {
}
public abstract class Parent5 extends Parent4 {
}
public class MyObject extends Parent5 {
}
}
And as you will see: SonarLint complains about the class "MyObject" to have 6 parents which is greater than 5 authorized. But obviously MyObject only has 5 Parents.
Am I wrong? Or is this really counted the wrong way?