Analysis of Graphalyze

Document Information

Analysed by SourceGraph (version 0.7.0.0) using Graphalyze (version 0.11.0.0)

Wednesday 24 November, 2010

1 Legend

Two normal functions with f calling g .
Function Call
Two modules with module Foo importing Bar .
Module Import
Entities from different modules.
From module
Data type declaration.
Data type declaration
Class and instance declarations.
Class declaration
Entity location/accessibility classification.
Entity Location
Edge classification.
Edge Classification
Edge Widths
The width of each edge is calculated by: width = log (number of function calls) + 1

2 Notes

Please note that the source-code analysis in this document is not necessarily perfect: SourceGraph is not a refactoring tool, and it's usage of Classes is still premature.

Implicitly exported entities refer to class methods that are instantiated but defined elsewhere, or entities whose names start with an underscore . Note that even for Main modules, these implicit exports are included.

All graph visualisations link to larger SVG versions of the same graph.

3 Analysis of the entire codebase

3.1 Visualisation of the entire software

Entire Codebase

3.2 Visualisation of overall function calls

Here is the current module grouping of functions:

Current module groupings

Here is a proposed alternate module grouping:

Using the Chinese Whispers algorithm:

Chinese Whispers module suggestions

3.3 Overall Core analysis

The core of software is calculated by recursively removing roots and leaves of the call graph; as such, it can be considered as the section where all the "real work" is done.

Overall core

3.4 Visualisation of levels in the software

Visualises how far away from the exported root entities an entity is.

Levels within software

3.5 Overall Cyclomatic Complexity

The overall cyclomatic complexity is: 249

For more information on cyclomatic complexity, please see: Wikipedia: Cyclomatic Complexity

3.6 Overall root analysis

These functions are those that are inaccessible:

Data.Graph.Analysis.Internal.addLabels', Data.Graph.Analysis.Internal.applyBoth, Data.Graph.Analysis.Internal.filterNodes', Data.Graph.Analysis.Internal.getLabels, Data.Graph.Analysis.Internal.getLabels', Data.Graph.Analysis.Internal.relLabel

3.7 Function component analysis

The functions are split up into 13 components. You may wish to consider splitting the code up into multiple libraries.

4 Analysis of module imports

4.1 Visualisation of imports

Import visualisation

4.2 Cyclomatic Complexity of imports

The cyclomatic complexity of the imports is: 14

For more information on cyclomatic complexity, please see: Wikipedia: Cyclomatic Complexity

5 Analysis of each module

5.1 Analysis of Data.Graph.Analysis

5.1.2 Visualisation of levels in Data.Graph.Analysis

Visualises how far away from the exported root entities an entity is.

Levels within Data.Graph.Analysis

5.1.3 Cyclomatic Complexity of Data.Graph.Analysis

The cyclomatic complexity of Data.Graph.Analysis is: 11.

For more information on cyclomatic complexity, please see: Wikipedia: Cyclomatic Complexity

5.1.4 Component analysis of Data.Graph.Analysis

The module Data.Graph.Analysis has 8 components. You may wish to consider splitting it up.

5.2 Analysis of Data.Graph.Analysis.Algorithms.Clustering

5.2.2 Visualisation of levels in Data.Graph.Analysis.Algorithms.Clustering

Visualises how far away from the exported root entities an entity is.

Levels within Data.Graph.Analysis.Algorithms.Clustering

5.2.3 Cyclomatic Complexity of Data.Graph.Analysis.Algorithms.Clustering

The cyclomatic complexity of Data.Graph.Analysis.Algorithms.Clustering is: 8.

For more information on cyclomatic complexity, please see: Wikipedia: Cyclomatic Complexity

5.2.4 Component analysis of Data.Graph.Analysis.Algorithms.Clustering

The module Data.Graph.Analysis.Algorithms.Clustering has 4 components. You may wish to consider splitting it up.

5.2.5 Chain analysis of Data.Graph.Analysis.Algorithms.Clustering

The module Data.Graph.Analysis.Algorithms.Clustering has the following chains:

  • collapseAllBy -> collapseAll

  • Class: Metric, Data: (PosLabel a) -> euclidian

  • maybeAdjustLabel -> adjustLabel

  • whisperNode -> whisper -> chooseWhisper

These chains can all be compressed down to a single function.

5.3 Analysis of Data.Graph.Analysis.Algorithms.Common

5.3.2 Core analysis of Data.Graph.Analysis.Algorithms.Common

The core of a module is calculated by recursively removing roots and leaves of the call graph; as such, it can be considered as the section where all the "real work" is done.

Core of Data.Graph.Analysis.Algorithms.Common

5.3.3 Visualisation of levels in Data.Graph.Analysis.Algorithms.Common

Visualises how far away from the exported root entities an entity is.

Levels within Data.Graph.Analysis.Algorithms.Common

5.3.4 Cyclomatic Complexity of Data.Graph.Analysis.Algorithms.Common

The cyclomatic complexity of Data.Graph.Analysis.Algorithms.Common is: 13.

For more information on cyclomatic complexity, please see: Wikipedia: Cyclomatic Complexity

5.3.5 Component analysis of Data.Graph.Analysis.Algorithms.Common

The module Data.Graph.Analysis.Algorithms.Common has 3 components. You may wish to consider splitting it up.

5.3.6 Clique analysis of Data.Graph.Analysis.Algorithms.Common

The module Data.Graph.Analysis.Algorithms.Common has the following cliques:

  • extractNode, nodeExtractor

5.3.7 Chain analysis of Data.Graph.Analysis.Algorithms.Common

The module Data.Graph.Analysis.Algorithms.Common has the following chains:

  • componentsOf -> splitComponent -> extractNode -> nodeExtractor

  • extractNode -> nodeExtractor

  • findRegular -> findRegularOf -> regularOf

  • isChainStart -> hasNext

These chains can all be compressed down to a single function.

5.4 Analysis of Data.Graph.Analysis.Algorithms.Directed

5.4.2 Visualisation of levels in Data.Graph.Analysis.Algorithms.Directed

Visualises how far away from the exported root entities an entity is.

Levels within Data.Graph.Analysis.Algorithms.Directed

5.4.3 Cyclomatic Complexity of Data.Graph.Analysis.Algorithms.Directed

The cyclomatic complexity of Data.Graph.Analysis.Algorithms.Directed is: 4.

For more information on cyclomatic complexity, please see: Wikipedia: Cyclomatic Complexity

5.4.4 Chain analysis of Data.Graph.Analysis.Algorithms.Directed

The module Data.Graph.Analysis.Algorithms.Directed has the following chains:

  • graphLevels' -> getNextLevel

  • keepOnlyInternal -> onlyInternalPred

These chains can all be compressed down to a single function.

5.5 Analysis of Data.Graph.Analysis.Internal

5.5.2 Visualisation of levels in Data.Graph.Analysis.Internal

Visualises how far away from the exported root entities an entity is.

Levels within Data.Graph.Analysis.Internal

5.5.3 Cyclomatic Complexity of Data.Graph.Analysis.Internal

The cyclomatic complexity of Data.Graph.Analysis.Internal is: 13.

For more information on cyclomatic complexity, please see: Wikipedia: Cyclomatic Complexity

5.5.4 Component analysis of Data.Graph.Analysis.Internal

The module Data.Graph.Analysis.Internal has 13 components. You may wish to consider splitting it up.

5.6 Analysis of Data.Graph.Analysis.Reporting

5.6.2 Visualisation of levels in Data.Graph.Analysis.Reporting

Visualises how far away from the exported root entities an entity is.

Levels within Data.Graph.Analysis.Reporting

5.6.3 Cyclomatic Complexity of Data.Graph.Analysis.Reporting

The cyclomatic complexity of Data.Graph.Analysis.Reporting is: 35.

For more information on cyclomatic complexity, please see: Wikipedia: Cyclomatic Complexity

5.6.4 Component analysis of Data.Graph.Analysis.Reporting

The module Data.Graph.Analysis.Reporting has 4 components. You may wish to consider splitting it up.

5.7 Analysis of Data.Graph.Analysis.Reporting.Pandoc

5.7.2 Core analysis of Data.Graph.Analysis.Reporting.Pandoc

The core of a module is calculated by recursively removing roots and leaves of the call graph; as such, it can be considered as the section where all the "real work" is done.

Core of Data.Graph.Analysis.Reporting.Pandoc

5.7.3 Visualisation of levels in Data.Graph.Analysis.Reporting.Pandoc

Visualises how far away from the exported root entities an entity is.

Levels within Data.Graph.Analysis.Reporting.Pandoc

5.7.4 Cyclomatic Complexity of Data.Graph.Analysis.Reporting.Pandoc

The cyclomatic complexity of Data.Graph.Analysis.Reporting.Pandoc is: 50.

For more information on cyclomatic complexity, please see: Wikipedia: Cyclomatic Complexity

5.7.5 Clique analysis of Data.Graph.Analysis.Reporting.Pandoc

The module Data.Graph.Analysis.Reporting.Pandoc has the following cliques:

  • elements, multiElems

  • elements, multiElems'

5.7.6 Chain analysis of Data.Graph.Analysis.Reporting.Pandoc

The module Data.Graph.Analysis.Reporting.Pandoc has the following chains:

  • defaultProps -> defaultWidth

  • inlines -> loc2target

  • multiElems' -> elements

These chains can all be compressed down to a single function.

5.8 Analysis of Data.Graph.Analysis.Types

5.8.2 Visualisation of levels in Data.Graph.Analysis.Types

Visualises how far away from the exported root entities an entity is.

Levels within Data.Graph.Analysis.Types

5.8.3 Cyclomatic Complexity of Data.Graph.Analysis.Types

The cyclomatic complexity of Data.Graph.Analysis.Types is: 26.

For more information on cyclomatic complexity, please see: Wikipedia: Cyclomatic Complexity

5.8.4 Component analysis of Data.Graph.Analysis.Types

The module Data.Graph.Analysis.Types has 4 components. You may wish to consider splitting it up.

5.9 Analysis of Data.Graph.Analysis.Utils

5.9.2 Core analysis of Data.Graph.Analysis.Utils

The core of a module is calculated by recursively removing roots and leaves of the call graph; as such, it can be considered as the section where all the "real work" is done.

Core of Data.Graph.Analysis.Utils

5.9.3 Visualisation of levels in Data.Graph.Analysis.Utils

Visualises how far away from the exported root entities an entity is.

Levels within Data.Graph.Analysis.Utils

5.9.4 Cyclomatic Complexity of Data.Graph.Analysis.Utils

The cyclomatic complexity of Data.Graph.Analysis.Utils is: 26.

For more information on cyclomatic complexity, please see: Wikipedia: Cyclomatic Complexity

5.9.5 Component analysis of Data.Graph.Analysis.Utils

The module Data.Graph.Analysis.Utils has 19 components. You may wish to consider splitting it up.

5.10 Analysis of Data.Graph.Analysis.Visualisation

5.10.2 Visualisation of levels in Data.Graph.Analysis.Visualisation

Visualises how far away from the exported root entities an entity is.

Levels within Data.Graph.Analysis.Visualisation

5.10.3 Cyclomatic Complexity of Data.Graph.Analysis.Visualisation

The cyclomatic complexity of Data.Graph.Analysis.Visualisation is: 3.

For more information on cyclomatic complexity, please see: Wikipedia: Cyclomatic Complexity

5.10.4 Component analysis of Data.Graph.Analysis.Visualisation

The module Data.Graph.Analysis.Visualisation has 2 components. You may wish to consider splitting it up.

5.10.5 Chain analysis of Data.Graph.Analysis.Visualisation

The module Data.Graph.Analysis.Visualisation has the following chains:

  • blockPrintWith' -> takeLen -> takeLine

These chains can all be compressed down to a single function.