The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

Analizo::Metric::NumberOfChildren - Number of Children (NOC) metric

DESCRIPTION

The metric calculation is based on the following article and calculates the number of immediate subclasses subordinate to a class in the hierarchy.

Article: Software Quality Metrics for Object-Oriented Environments by Linda H. Rosenberg and Lawrence E. Hyatt.

See the paragraph about Number of Children in the article:

The number of children is the number of immediate subclasses subordinate to a class in the hierarchy. It is an indicator of the potential influence a class can have on the design and on the system. The greater the number of children, the greater the likelihood of improper abstraction of the parent and may be a case of misuse of subclassing. But the greater the number of children, the greater the reusability since inheritance is a form of reuse. If a class has a large number of children, it may require more testing of the methods of that class, thus increase the testing time.