microsoft / PSDocs
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 795 units with 6,376 lines of code in units (59.9% of code).
    • 0 very long units (0 lines of code)
    • 2 long units (148 lines of code)
    • 35 medium size units (949 lines of code)
    • 132 small units (1,843 lines of code)
    • 626 very small units (3,436 lines of code)
0% | 2% | 14% | 28% | 53%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs0% | 2% | 14% | 28% | 53%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/PSDocs/Processor0% | 28% | 15% | 19% | 36%
src/PSDocs/Common0% | 3% | 33% | 26% | 35%
src/PSDocs/Pipeline0% | 0% | 12% | 21% | 66%
src/PSDocs/Commands0% | 0% | 16% | 40% | 42%
src/PSDocs/Runtime0% | 0% | 8% | 26% | 64%
src/PSDocs/Models0% | 0% | 20% | 35% | 44%
src/PSDocs.Benchmark0% | 0% | 21% | 26% | 52%
src/PSDocs/Definitions0% | 0% | 0% | 46% | 53%
src/PSDocs/Configuration0% | 0% | 0% | 26% | 73%
src/PSDocs/Data0% | 0% | 0% | 49% | 50%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private static void Table()
in src/PSDocs/Processor/Markdown/MarkdownProcessor.cs
95 34 2
private static bool GetField()
in src/PSDocs/Common/ObjectHelper.cs
53 20 4
private static void ReadObject()
in src/PSDocs/Common/JsonConverters.cs
39 8 2
protected override PipelineStream PrepareStream()
in src/PSDocs/Pipeline/InvokePipeline.cs
39 7 0
public int IndexOf()
in src/PSDocs/Common/ObjectHelper.cs
38 11 1
internal static bool CompareNumeric()
in src/PSDocs/Common/ExpressionHelpers.cs
36 12 5
private IResource MapResource()
in src/PSDocs/Common/YamlConverters.cs
36 9 3
private static PSObject ReadObject()
in src/PSDocs/Common/JsonConverters.cs
32 10 1
public bool TryMatchAA()
in src/PSDocs/Pipeline/PathBuilder.cs
32 8 2
internal static bool TryLong()
in src/PSDocs/Common/ExpressionHelpers.cs
31 9 3
private static void Node()
in src/PSDocs/Processor/Markdown/MarkdownProcessor.cs
31 9 2
private PSNoteProperty ReadNoteProperty()
in src/PSDocs/Common/YamlConverters.cs
30 7 2
private void BuildReader()
in src/PSDocs/Commands/TableCommand.cs
29 6 0
private static void RunProfile()
in src/PSDocs.Benchmark/Program.cs
27 2 1
public bool TryMatchA()
in src/PSDocs/Pipeline/PathBuilder.cs
27 5 2
private static string ReadAsString()
in src/PSDocs/Pipeline/PipelineReceiver.cs
27 4 2
private static TextReader ReadAsReader()
in src/PSDocs/Pipeline/PipelineReceiver.cs
27 4 2
internal static bool TryInt()
in src/PSDocs/Common/ExpressionHelpers.cs
26 9 3
internal static bool TryDateTime()
in src/PSDocs/Common/ExpressionHelpers.cs
26 9 3
public object ReadYaml()
in src/PSDocs/Common/YamlConverters.cs
26 6 2