IntelliJ IDEA 2021.1 Help

DSM Tool Window

View | Tool Windows | DSM

  • This tool window becomes available after performing DSM analysis.

  • Make sure that Dependency Structure Matrix plugin is installed and enabled. Refer to the Plugins page of the Settings dialog.

Here you can see the typical matrix view.

Matrix View

The row headers represent program structure. Everything is collapsed now and only modules are shown. When expanded, the header is tree-like, allowing you to expand modules and dig into program packages. * - node groups classes inside the package. The column headers are the same as the corresponding row headers. Thus they are not shown in order to save space. Instead, different visual aids are used on the row headers.

If you select a row, the matrix will look like this.

Matrix view when a row is selected

Here you can learn the following:

  1. The selected row and corresponding column are highlighted to visualize row dependencies.

  2. The ellipsis in the cell means that the maven-core module has many (more than 99) dependencies on maven-project module.

  3. The column shows the dependencies of the selected row.

  4. The row shows the dependencies on the selected row.

  5. This means that the maven-project module has 16 dependencies on maven-settings module.

  6. Various shades correspond to the number of dependencies.

Dependencies
  • Color annotations help to visualize row dependencies at a glance.

  • maven-core depends on maven-project.

  • maven-project depends on maven-profile.

  • The dashes on the diagonal correspond to self dependencies which are not shown.

You can select any cell to explore the dependencies indicated in it.

Cell dependencies

The cell #1 was selected. These color annotations mean that maven-project has 16 dependencies onmaven-settings. The symmetrical cell (cell #2) shows dependencies in the other direction - in this case zero.

There is a simple mnemonic rule - all dependencies always flow from Green to Yellow.

Instead of alphabetically sorting rows, DSM view sorts dependencies in a special way: classes, which are used most are moved to the bottom. In a project with good structure this creates a triangular shape in the lower left half of the matrix.

Cycles

Cycles

Mutual dependencies are shown in red. It means that the plugin and usability packages are both dependent on each other.

Patterns

There are two types of visual patterns. Vertical lines represent aggregators.

Aggregators

Horizontal lines appear in lowest-level or utility functionality.

Lowest-level or utility functionality
Last modified: 23 April 2021