ReportCoupling

Produce a html, etc. report for a coupling analysis.

Process a dgml file generated from a coupling analysis.

Expected usage: DeepEnds ReportCoupling <options> filenames
<options> available:
      --output               Required. Path for writing HTML (*.html|*.htm),
                               markdown (*.md), source for doxygen (*.cs, etc.) or the main table
                               (*.csv) containing various statistics
      --split                Default(false). Whether to split the report into
                               multiple files. Values are true and false

Examples:
  DeepEnds ReportCoupling --split=true --output=C:\Results\Coupling\split.cs C:\Source\coupling.dgml
      - read a coupling graph and create a set of C# files in C:\Results\Coupling for doxygen
  DeepEnds ReportCoupling --output=C:\Results\coupling.csv C:\Source\coupling.dgml
      - read a coupling graph and create a table
  DeepEnds ReportCoupling --output=C:\Results\coupling.html C:\Source\coupling.dgml
      - read a coupling graph and create a html report
  DeepEnds ReportCoupling --output=C:\Results\coupling.md C:\Source\coupling.dgml
      - read a coupling graph and create a markdown report

Having created a DGML file using a tool for reading the source code with extract set to coupling this tool then post-processes it.

The main table in the resulting report includes various statistics including the Cyclomatic Number and the number of lines of code.

Example output follows


The following sections refer to the individual sections for each level.

Table

The table is grouped by columns. The summary table is sorted on the value of the value of (E+P-N)/N, subsequent instances are sorted on the section name.

Section

The node label of the graph (with the obvious exception of “Top level”).

Cycle

If a cycle in the graph (circular dependency) occurs then the word cycle will appear as the value otherwise it is left blank.

Cyclomatic Number

The larger the value of (E + P) / N then the more complex the directed graph is, where

The value of (E + P - N) / N varies between 0 and N. A strictly layered architecture will have a value of 0.

The sum refers to the sum of the value to its left plus all the values at its child nodes, recursively.

Externals

Externals refers to the number of dependencies which aren’t children. The following max refers to the maximum of that value and the value at any child nodes.

SLOC

SLOC stands for source lines of code; whilst reading the source an attempt may have been made not to count blank or comment lines. The max and sum are calculated over the child nodes recursively down to the leaf nodes.

Probability of SLOC

An attempt has been made to fit the log-normal distribution to SLOC which has then been used to calculate the expected file size, this is not displayed if there is only one value to fit (so as to avoid domination of the statistic by boilerplate). This value is bracketed by the lower and upper limits of the 90% confidence interval if the upper limit is less than the maximal value of SLOC on a leaf, otherwise it is left blank. The following max refers to the maximum of the expected value and the value at any child nodes.

Lines of code

This table is a list of leaf nodes versus the number of lines of code sorted on decreasing size.

Usage

This table is an alphabetically sorted list of the leaf nodes in this level versus their usage at this level and all higher levels. Once the maximal value has been achieved for a row the subsequent columns are filled with blanks.

Interface

This table is an alphabetically sorted list of the leaf nodes that aren’t used at a higher level.

Externals

This table is an alphabetically sorted list of the leaf nodes that are dependencies but aren’t children of this level.

Internals

This table is an alphabetically sorted list of the leaf nodes that constitute the dependencies from which the edges are formed. Note that dependent nodes are not included unless they also happen to be depended upon.

Edge definitions

The edges are defined by underlying dependencies. For each edge a table lists all the pairs of leaf nodes that the edge is composed of.

Structure Matrix

The structure matrix represents the dependency of one node upon another in the level. To work out what a node depends on read along a row until the value of 1 is encountered then read vertically to the diagonal (represented by a backslash). The row containing that diagonal is the corresponding dependency.

The rows of the matrix have been sorted in the attempt to ensure that the 1’s are below the diagonal. If this is not the case then a cycle exists in the corresponding graph. i.e. a circular dependency exists.

Summary of graph complexity

Table

The following table is sorted on the value of (E+P-N)/N, subsequent instances of this table type are sorted on the section name.

Section Cycle (E + P - N) / N     E + P - N     N     Externals   SLOC   Probability of SLOC      
    Val Max Sum Val Max Sum Val Max Sum Count Max Max Sum Lower Exp Upper Max
DeepEnds.Core   0.31 0.31 0.31 4 4 4 13 13 13 0 5 127 427   19   19
Top level   0.00 2.16 5.62 0 41 79 1 19 117 0 15 666 5304 3 26 232 83

DeepEnds.Core

Table

Section Cycle (E + P - N) / N     E + P - N     N     Externals   SLOC   Probability of SLOC      
    Val Max Sum Val Max Sum Val Max Sum Count Max Max Sum Lower Exp Upper Max
DeepEnds.Core   0.31 0.31 0.31 4 4 4 13 13 13 0 5 127 427   19   19

Lines of code

Dependency SLOC
DeepEnds.Core.ToolUtils 127
DeepEnds.Core.Dependencies 68
DeepEnds.Core.Paths 56
DeepEnds.Core.Dependency 42
DeepEnds.Core.DiGraph 25
DeepEnds.Core.Property 25
DeepEnds.Core.Sources 25
DeepEnds.Core.Splitter 24
DeepEnds.Core.SourceProvider 14
DeepEnds.Core.Linkings 9
DeepEnds.Core.ITool 6
DeepEnds.Core.DependencyWalker 3
DeepEnds.Core.IProperty 3

Usage

Dependency Sum at this level    
  Core DeepEnds Top Level
Dependencies 1 19  
Dependency 7 48  
DependencyWalker 0 6  
DiGraph 0 38  
IProperty 1 12  
ITool 1 12  
Linkings 1 11  
Paths 1 9  
Property 0 4  
SourceProvider 1 14  
Sources 1 12  
Splitter 1 4  
ToolUtils 0 11  

Internals

Internal Dependencies
DeepEnds.Core.Dependencies
DeepEnds.Core.Dependency
DeepEnds.Core.IProperty
DeepEnds.Core.ITool
DeepEnds.Core.Linkings
DeepEnds.Core.Paths
DeepEnds.Core.SourceProvider
DeepEnds.Core.Sources
DeepEnds.Core.Splitter

Edge definitions

Structure Matrix

Dependency                          
Dependency \                        
ITool   \                      
Paths     \                    
SourceProvider       \                  
Splitter         \                
Dependencies 1         \              
DependencyWalker 1           \            
IProperty 1             \          
ToolUtils   1     1       \        
Linkings 1                 \      
Property 1             1     \    
Sources 1     1               \  
DiGraph 1   1     1       1   1 \