scitools.com

← Metric catalog

Disconnected File Groups is one of the source-code metrics Understand computes across 17+ languages — browse them in the GUI, export and track them, or script them with the Python API.

Disconnected File Groups

API ID: CountFileGroupsDisconnected
Languages: Any
Targets: Architectures, Project

The number of groups of files with no dependencies between groups.

A connected file group is a set of files linked by dependencies in either direction: a file belongs to a group if it depends on a file in the group or a file in the group depends on it. No dependencies cross between groups. In graph terms, the groups are the weakly connected components of the file dependency graph. Each file with no dependencies to or from other files is a group by itself.

For an architecture, only dependencies between files inside the architecture count.

To see the groups, use the Connected File Groups architecture.

A value of 1 means every file is connected to the rest. Large values usually come from isolated files, such as test fixtures, examples or unused code, or from independent subprojects analyzed together.

For example, consider a project with three files where A depends on B and C has no dependencies.


A and B form one group and C forms its own group, so the number of disconnected file groups is 2.