DesigniteJava icon indicating copy to clipboard operation
DesigniteJava copied to clipboard

False positives in Deficient Encapsulation design smell detection

Open AntonisGkortzis opened this issue 7 years ago • 1 comments

This is caused due to counting the public fields of an inner class while the inner class is private.

When inner class is private her fields should not affect the Encapsulation Efficiency status of the outer class.

AntonisGkortzis avatar Jul 27 '18 08:07 AntonisGkortzis

Temporarily fixed with the use of regex.

In case that nested types exist, each field of the outer type is parsed in order to check if this belongs to a nested class. When this is satisfied and the nested class is not public then the field is not accounted for the Deficient Encapsulation.

AntonisGkortzis avatar Jul 27 '18 12:07 AntonisGkortzis