Too many parents in library class

2,263 views
Skip to first unread message

Brian Sperlongano

unread,
Dec 1, 2015, 3:16:19 PM12/1/15
to SonarQube
I have a class that extends ch.qos.logback.core.rolling.RollingFileAppender.  It is part of the logback library (i.e. not my code).  SonarQube currently flags a warning "This class has 6 parents which is greater than the 5 authorized."  I think that this is a false positive when counting classes that are in outside libraries and that only "my" code should be counted towards the limit on the maximum number of parents.

Nicolas Peru

unread,
Jan 8, 2016, 10:54:16 AM1/8/16
to Brian Sperlongano, SonarQube
Hi, 

I tend to disagree, even if you are using an external library you might want to get a warning when you are adding more and more layers to the hierarchy. You may want to raise the threshold because of a design of an external framework but not necessarily abstract the fact that you are getting a big type hierarchy with it.

Cheers,


Nicolas PERU | SonarSource
Senior Developer
http://sonarsource.com


2015-12-01 21:16 GMT+01:00 Brian Sperlongano <zelon...@gmail.com>:
I have a class that extends ch.qos.logback.core.rolling.RollingFileAppender.  It is part of the logback library (i.e. not my code).  SonarQube currently flags a warning "This class has 6 parents which is greater than the 5 authorized."  I think that this is a false positive when counting classes that are in outside libraries and that only "my" code should be counted towards the limit on the maximum number of parents.

--
You received this message because you are subscribed to the Google Groups "SonarQube" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sonarqube+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/sonarqube/219378ac-9ef3-40ce-81ac-b483fc74e1b8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

filenk...@gmail.com

unread,
Nov 11, 2017, 1:17:47 AM11/11/17
to SonarQube
Sonar warnings needs to fix bugs, isn't it? But what can be corrected in this situation?
If I raise the threshold, it will apply everywhere. Then I will lose need the warnings on my code.

пятница, 8 января 2016 г., 18:54:16 UTC+3 пользователь Nicolas Peru написал:
Reply all
Reply to author
Forward
0 new messages