microsoft / Dynamics365FO-AppChecker
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 1,709 units with 20,032 lines of code in units (58.9% of code).
    • 6 very long units (1,550 lines of code)
    • 15 long units (1,062 lines of code)
    • 68 medium size units (2,058 lines of code)
    • 616 small units (7,367 lines of code)
    • 1,004 very small units (7,995 lines of code)
7% | 5% | 10% | 36% | 39%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs6% | 4% | 9% | 39% | 39%
go72% | 0% | 7% | 12% | 7%
py0% | 12% | 13% | 16% | 57%
js0% | 0% | 79% | 0% | 20%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Extractors/Go72% | 0% | 7% | 12% | 7%
tools/Graph Explorer23% | 6% | 33% | 10% | 26%
tools/Explorer15% | 19% | 26% | 18% | 20%
tools/AstVisualizer1% | <1% | 2% | 48% | 46%
Extractors/Python0% | 12% | 13% | 16% | 57%
tools/Workflows0% | 33% | 11% | 47% | 7%
tools/BaseXInterface0% | 0% | 21% | 30% | 47%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
func Walk()
in Extractors/Go/walker.go
491 137 4
public ViewModel()
in tools/Explorer/ViewModels/ViewModel.cs
425 37 2
public ViewModel()
in tools/AstVisualizer/AstVisualizer/ViewModel/ViewModel.cs
207 17 2
public static string GenerateHtml()
in tools/Graph Explorer/GraphExplorer/Models/Model.cs
171 22 1
public EditorViewModel()
in tools/Graph Explorer/GraphExplorer/ViewModels/EditorViewModel.cs
134 18 2
public static string GenerateJSON()
in tools/Graph Explorer/GraphExplorer/Models/Model.cs
122 18 1
public SourceEditor()
in tools/Explorer/Views/SourceEditor.cs
98 2 0
private Size MeasureHorizontal()
in tools/Explorer/TabControl/TabPanel.cs
85 15 1
def foo()
in Extractors/Python/extractor/tests.py
83 1 0
private Size MeasureVertical()
in tools/Explorer/TabControl/TabPanel.cs
83 14 1
public static void Main()
in tools/Workflows/BulkQuery/Program.cs
83 15 10
public Snippets()
in tools/Explorer/Views/Snippets.cs
77 1 0
public ResultsEditor()
in tools/Explorer/Views/ResultsEditor.cs
75 1 0
def visitExpression()
in Extractors/Python/extractor/xmlnodegenerator.py
67 31 2
public void Draw()
in tools/AstVisualizer/AstVisualizer/Views/TextMarkerService.cs
62 14 2
public void Draw()
in tools/Explorer/Views/TextMarkerService.cs
62 14 2
private async Task GetJobsStatusAsync()
in tools/Explorer/ViewModels/SubmittedQueriesViewModel.cs
59 8 0
def reverseArray()
in tools/AstVisualizer/PythonExtractor/Extractor.cs
58 4 3
private async Task InitializeAsync()
in tools/Graph Explorer/GraphExplorer/MainWindow.xaml.cs
58 3 0
def visitStatement()
in Extractors/Python/extractor/xmlnodegenerator.py
57 26 2