#684 Fan Out Complexity check should exclude java.lang

release_1.0
closed
Oliver Burn
5
2015-01-16
2012-10-08
Vincent Massol
No

I see in the code of AbstractClassCouplingCheck that java.lang are meant to be excluded:

    private boolean isSignificant(String aClassName)
    {
        return (aClassName.length() > 0)
                && !mIgnoredClassNames.contains(aClassName)
                && !aClassName.startsWith("java.lang.");
    }

However in practice they are not excluded since the class names that are checked do NOT have their full package name computed.
For example "java.lang.Class" gets counted since only "Class" is passed to isSignificant().

This is a a big issue...

Discussion

  • Oliver Burn
    Oliver Burn
    2012-10-10

    Can you please supply a sample file demonstrating the problem. I can then use this to fix the problem.

     
  • Vincent Massol
    Vincent Massol
    2012-11-06

    Hi Oliver,

    We're keen to see this bug fixed ASAP since it's starting to bite us in a lot of places on the XWiki project and we're starting to have lots of checkstyle-suppressions.xml file around to exclude the Fan out check where it's failing because of java.lang.* imports.

    Let me know if there's an easy way for me to help you on this. Thanks!

     
  • Vincent Massol
    Vincent Massol
    2013-02-22

    Oliver, any update on this?

    What can I do to make this issue progress?

    Thanks

     
  • Roman Ivanov
    Roman Ivanov
    2013-10-26

    • labels: Core Framework --> NeedAutorReply
    • Group: --> release_1.0
     
  • Vincent Massol
    Vincent Massol
    2013-10-27

    I've tried to provide a PR for this but it's too complex. I don't know how to compute the full name of a class found in the AST of a given class. It's really complex. Thus I'd just suggest to remove the check "!aClassName.startsWith("java.lang.")" which is both useless and misleading.

     
  • Roman Ivanov
    Roman Ivanov
    2013-11-05

    • status: open --> closed
     
  • Roman Ivanov
    Roman Ivanov
    2013-11-05

    issue was moved to github