tushartushar / DesigniteJava

Detects smells and computes metrics of Java code
https://www.designite-tools.com/products-dj
Apache License 2.0
172 stars 64 forks source link

False positives in Deficient Encapsulation design smell detection #57

Open AntonisGkortzis opened 6 years ago

AntonisGkortzis commented 6 years ago

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 commented 6 years ago

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.