CodeQL library for Java/Kotlin
codeql/java-all 1.1.0 (changelog, source)

Member predicate MetricPackage::getAbstractness

Abstractness metric.

Abstractness measures the proportion of abstract types in a package relative to the total number of types in that package. A highly abstract package (where the metric value is close 1) that is furthermore unstable is likely to be useless: the class hierarchy has been over-engineered, and all those abstract types are not heavily used.

One should try to design packages that are abstract in proportion to their incoming dependencies, and concrete in proportion to their outgoing dependencies. Such an approach is likely to facilitate making changes to the code.

See Java Design: Objects, UML, and Process by R. C. Martin for further discussion of these metrics and their use.

float getAbstractness()