Analysis of SourceGraph

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: 655

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

3.6 Overall root analysis

These functions are those that are inaccessible:

Analyse.GraphRepr.updateCollapsed, Parsing.Types.callType, Parsing.Types.clusterEntityM, Parsing.Types.clusterEntityM', Parsing.Types.defEntity, Parsing.Types.fromEntity, Parsing.Types.modPathClust, Parsing.Types.moduleRelationships, Parsing.Types.modulesIn, Parsing.Types.setEntModule, Parsing.Types.setEntModules, Parsing.Types.setUnion, Parsing.Types.toEntity

3.7 Function component analysis

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

3.8 Overall chain analysis

The code has the following cross-module chains:

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

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: 21

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

5 Analysis of each module

5.1 Analysis of Analyse

5.1.2 Visualisation of levels in Analyse

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

Levels within Analyse

5.1.3 Cyclomatic Complexity of Analyse

The cyclomatic complexity of Analyse is: 8.

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

5.1.4 Component analysis of Analyse

The module Analyse has 2 components. You may wish to consider splitting it up.

5.2 Analysis of Analyse.Colors

5.2.2 Visualisation of levels in Analyse.Colors

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

Levels within Analyse.Colors

5.2.3 Cyclomatic Complexity of Analyse.Colors

The cyclomatic complexity of Analyse.Colors is: 12.

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

5.2.4 Component analysis of Analyse.Colors

The module Analyse.Colors has 12 components. You may wish to consider splitting it up.

5.3 Analysis of Analyse.Everything

5.3.2 Visualisation of levels in Analyse.Everything

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

Levels within Analyse.Everything

5.3.3 Cyclomatic Complexity of Analyse.Everything

The cyclomatic complexity of Analyse.Everything is: 3.

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

5.4 Analysis of Analyse.GraphRepr

5.4.2 Visualisation of levels in Analyse.GraphRepr

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

Levels within Analyse.GraphRepr

5.4.3 Cyclomatic Complexity of Analyse.GraphRepr

The cyclomatic complexity of Analyse.GraphRepr is: 30.

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

5.4.4 Component analysis of Analyse.GraphRepr

The module Analyse.GraphRepr has 2 components. You may wish to consider splitting it up.

5.4.5 Chain analysis of Analyse.GraphRepr

The module Analyse.GraphRepr has the following chains:

  • collapseStructures -> collapseFuncs -> mkCollapseTp

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

5.5 Analysis of Analyse.Imports

5.5.2 Visualisation of levels in Analyse.Imports

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

Levels within Analyse.Imports

5.5.3 Cyclomatic Complexity of Analyse.Imports

The cyclomatic complexity of Analyse.Imports is: 1.

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

5.5.4 Chain analysis of Analyse.Imports

The module Analyse.Imports has the following chains:

  • importsToGraph -> moduleImports

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

5.6 Analysis of Analyse.Module

5.6.2 Visualisation of levels in Analyse.Module

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

Levels within Analyse.Module

5.6.3 Cyclomatic Complexity of Analyse.Module

The cyclomatic complexity of Analyse.Module is: 1.

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

5.6.4 Chain analysis of Analyse.Module

The module Analyse.Module has the following chains:

  • analyseModules -> analyseModule

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

5.7 Analysis of Analyse.Utils

5.7.2 Visualisation of levels in Analyse.Utils

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

Levels within Analyse.Utils

5.7.3 Cyclomatic Complexity of Analyse.Utils

The cyclomatic complexity of Analyse.Utils is: 6.

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

5.7.4 Component analysis of Analyse.Utils

The module Analyse.Utils has 6 components. You may wish to consider splitting it up.

5.8 Analysis of Analyse.Visualise

5.8.2 Visualisation of levels in Analyse.Visualise

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

Levels within Analyse.Visualise

5.8.3 Cyclomatic Complexity of Analyse.Visualise

The cyclomatic complexity of Analyse.Visualise is: 9.

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

5.9 Analysis of CabalInfo

5.9.2 Visualisation of levels in CabalInfo

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

Levels within CabalInfo

5.9.3 Cyclomatic Complexity of CabalInfo

The cyclomatic complexity of CabalInfo is: 1.

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

5.10 Analysis of Main

5.10.2 Visualisation of levels in Main

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

Levels within Main

5.10.3 Cyclomatic Complexity of Main

The cyclomatic complexity of Main is: 14.

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

5.10.4 Chain analysis of Main

The module Main has the following chains:

  • isTrivial -> isSetup

  • parseCabal' -> fpToModule

  • parseHaskellFiles -> readFiles -> readFileContents

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

5.11 Analysis of Parsing

5.11.2 Visualisation of levels in Parsing

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

Levels within Parsing

5.11.3 Cyclomatic Complexity of Parsing

The cyclomatic complexity of Parsing is: 1.

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

5.11.4 Chain analysis of Parsing

The module Parsing has the following chains:

  • parseHaskell -> parseFiles -> parseFile

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

5.12 Analysis of Parsing.ParseModule

5.12.2 Core analysis of Parsing.ParseModule

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 Parsing.ParseModule

5.12.3 Visualisation of levels in Parsing.ParseModule

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

Levels within Parsing.ParseModule

5.12.4 Cyclomatic Complexity of Parsing.ParseModule

The cyclomatic complexity of Parsing.ParseModule is: 191.

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

5.12.5 Clique analysis of Parsing.ParseModule

The module Parsing.ParseModule has the following cliques:

  • getBindings, getDecl

  • getExp, getExps

  • getExp, getPat

  • getExp, getStmt

  • getPField, getPat

  • getPat, getPats

  • getStmt, getStmts

5.12.6 Cycle analysis of Parsing.ParseModule

The module Parsing.ParseModule has the following non-clique cycles:

  • getAlt -> getBindings -> getDecl -> getMatch -> getPats -> getPat -> getExp -> getAlt

  • getAlt -> getBindings -> getDecl -> getMatch -> getRHS -> getExp -> getAlt

  • getAlt -> getBindings -> getDecl -> getMatch -> getRHS -> getGRhs -> getExp -> getAlt

  • getAlt -> getBindings -> getDecl -> getMatch -> getRHS -> getGRhs -> getStmts -> getStmt -> getExp -> getAlt

  • getAlt -> getBindings -> getDecl -> getMatch -> getRHS -> getGRhs -> getStmts -> getStmt -> getPat -> getExp -> getAlt

  • getAlt -> getBindings -> getDecl -> getPat -> getExp -> getAlt

  • getAlt -> getBindings -> getDecl -> getRHS -> getExp -> getAlt

  • getAlt -> getBindings -> getDecl -> getRHS -> getGRhs -> getExp -> getAlt

  • getAlt -> getBindings -> getDecl -> getRHS -> getGRhs -> getStmts -> getStmt -> getExp -> getAlt

  • getAlt -> getBindings -> getDecl -> getRHS -> getGRhs -> getStmts -> getStmt -> getPat -> getExp -> getAlt

  • getAlt -> getBindings -> getIPBinds -> getExp -> getAlt

  • getAlt -> getGAlts -> getExp -> getAlt

  • getAlt -> getGAlts -> getGAlt -> getExp -> getAlt

  • getAlt -> getGAlts -> getGAlt -> getStmts -> getStmt -> getBindings -> getDecl -> getMatch -> getPats -> getPat -> getExp -> getAlt

  • getAlt -> getGAlts -> getGAlt -> getStmts -> getStmt -> getBindings -> getDecl -> getMatch -> getRHS -> getExp -> getAlt

  • getAlt -> getGAlts -> getGAlt -> getStmts -> getStmt -> getBindings -> getDecl -> getMatch -> getRHS -> getGRhs -> getExp -> getAlt

  • getAlt -> getGAlts -> getGAlt -> getStmts -> getStmt -> getBindings -> getDecl -> getPat -> getExp -> getAlt

  • getAlt -> getGAlts -> getGAlt -> getStmts -> getStmt -> getBindings -> getDecl -> getRHS -> getExp -> getAlt

  • getAlt -> getGAlts -> getGAlt -> getStmts -> getStmt -> getBindings -> getDecl -> getRHS -> getGRhs -> getExp -> getAlt

  • getAlt -> getGAlts -> getGAlt -> getStmts -> getStmt -> getBindings -> getIPBinds -> getExp -> getAlt

  • getAlt -> getGAlts -> getGAlt -> getStmts -> getStmt -> getExp -> getAlt

  • getAlt -> getGAlts -> getGAlt -> getStmts -> getStmt -> getPat -> getExp -> getAlt

  • getAlt -> getPat -> getExp -> getAlt

  • getBindings -> getDecl -> getMatch -> getBindings

  • getBindings -> getDecl -> getMatch -> getPats -> getPat -> getExp -> getBindings

  • getBindings -> getDecl -> getMatch -> getPats -> getPat -> getExp -> getQStmts -> getQStmt -> getStmt -> getBindings

  • getBindings -> getDecl -> getMatch -> getPats -> getPat -> getExp -> getStmt -> getBindings

  • getBindings -> getDecl -> getMatch -> getPats -> getPat -> getExp -> getStmts -> getStmt -> getBindings

  • getBindings -> getDecl -> getMatch -> getRHS -> getExp -> getBindings

  • getBindings -> getDecl -> getMatch -> getRHS -> getExp -> getQStmts -> getQStmt -> getStmt -> getBindings

  • getBindings -> getDecl -> getMatch -> getRHS -> getExp -> getStmt -> getBindings

  • getBindings -> getDecl -> getMatch -> getRHS -> getExp -> getStmts -> getStmt -> getBindings

  • getBindings -> getDecl -> getMatch -> getRHS -> getGRhs -> getExp -> getBindings

  • getBindings -> getDecl -> getMatch -> getRHS -> getGRhs -> getExp -> getQStmts -> getQStmt -> getStmt -> getBindings

  • getBindings -> getDecl -> getMatch -> getRHS -> getGRhs -> getExp -> getStmt -> getBindings

  • getBindings -> getDecl -> getMatch -> getRHS -> getGRhs -> getExp -> getStmts -> getStmt -> getBindings

  • getBindings -> getDecl -> getMatch -> getRHS -> getGRhs -> getStmts -> getStmt -> getBindings

  • getBindings -> getDecl -> getMatch -> getRHS -> getGRhs -> getStmts -> getStmt -> getExp -> getBindings

  • getBindings -> getDecl -> getMatch -> getRHS -> getGRhs -> getStmts -> getStmt -> getPat -> getExp -> getBindings

  • getBindings -> getDecl -> getPat -> getExp -> getBindings

  • getBindings -> getDecl -> getPat -> getExp -> getQStmts -> getQStmt -> getStmt -> getBindings

  • getBindings -> getDecl -> getPat -> getExp -> getStmt -> getBindings

  • getBindings -> getDecl -> getPat -> getExp -> getStmts -> getStmt -> getBindings

  • getBindings -> getDecl -> getRHS -> getExp -> getBindings

  • getBindings -> getDecl -> getRHS -> getExp -> getQStmts -> getQStmt -> getStmt -> getBindings

  • getBindings -> getDecl -> getRHS -> getExp -> getStmt -> getBindings

  • getBindings -> getDecl -> getRHS -> getExp -> getStmts -> getStmt -> getBindings

  • getBindings -> getDecl -> getRHS -> getGRhs -> getExp -> getBindings

  • getBindings -> getDecl -> getRHS -> getGRhs -> getExp -> getQStmts -> getQStmt -> getStmt -> getBindings

  • getBindings -> getDecl -> getRHS -> getGRhs -> getExp -> getStmt -> getBindings

  • getBindings -> getDecl -> getRHS -> getGRhs -> getExp -> getStmts -> getStmt -> getBindings

  • getBindings -> getDecl -> getRHS -> getGRhs -> getStmts -> getStmt -> getBindings

  • getBindings -> getDecl -> getRHS -> getGRhs -> getStmts -> getStmt -> getExp -> getBindings

  • getBindings -> getDecl -> getRHS -> getGRhs -> getStmts -> getStmt -> getPat -> getExp -> getBindings

  • getBindings -> getIPBinds -> getExp -> getBindings

  • getBindings -> getIPBinds -> getExp -> getQStmts -> getQStmt -> getStmt -> getBindings

  • getBindings -> getIPBinds -> getExp -> getStmt -> getBindings

  • getBindings -> getIPBinds -> getExp -> getStmts -> getStmt -> getBindings

  • getExp -> getFUpdates -> getFUpdate -> getExp

  • getExp -> getPats -> getPat -> getExp

  • getExp -> getQStmts -> getQStmt -> getExp

  • getExp -> getQStmts -> getQStmt -> getStmt -> getExp

  • getExp -> getQStmts -> getQStmt -> getStmt -> getPat -> getExp

  • getExp -> getStmt -> getPat -> getExp

  • getExp -> getStmts -> getStmt -> getExp

  • getExp -> getStmts -> getStmt -> getPat -> getExp

5.12.7 Chain analysis of Parsing.ParseModule

The module Parsing.ParseModule has the following chains:

  • addClassDecl -> addCDecl

  • addInstDecl -> addIDecl

  • getFUpdates -> getFUpdate

  • Class: ModuleItem, Data: (Maybe [ExportSpec]) -> listedExp

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

5.13 Analysis of Parsing.State

5.13.2 Visualisation of levels in Parsing.State

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

Levels within Parsing.State

5.13.3 Cyclomatic Complexity of Parsing.State

The cyclomatic complexity of Parsing.State is: 6.

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

5.13.4 Component analysis of Parsing.State

The module Parsing.State has 2 components. You may wish to consider splitting it up.

5.14 Analysis of Parsing.Types

5.14.2 Visualisation of levels in Parsing.Types

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

Levels within Parsing.Types

5.14.3 Cyclomatic Complexity of Parsing.Types

The cyclomatic complexity of Parsing.Types is: 74.

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

5.14.4 Component analysis of Parsing.Types

The module Parsing.Types has 4 components. You may wish to consider splitting it up.