microsoft / PSRule
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,828 units with 16,835 lines of code in units (62.8% of code).
    • 0 very long units (0 lines of code)
    • 9 long units (547 lines of code)
    • 135 medium size units (3,784 lines of code)
    • 366 small units (5,188 lines of code)
    • 1,318 very small units (7,316 lines of code)
0% | 3% | 22% | 30% | 43%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs0% | 3% | 22% | 30% | 43%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/PSRule/Pipeline0% | 5% | 14% | 30% | 49%
src/PSRule/Commands0% | 19% | 40% | 19% | 21%
src/PSRule/Common0% | 2% | 41% | 20% | 35%
src/PSRule/Host0% | 13% | 26% | 14% | 45%
src/PSRule/Parser0% | 5% | 27% | 29% | 37%
src/PSRule/Runtime0% | 0% | 22% | 35% | 41%
src/PSRule/Definitions0% | 0% | 22% | 34% | 42%
src/PSRule/Configuration0% | 0% | 8% | 43% | 47%
src/PSRule.Benchmark0% | 0% | 22% | 17% | 59%
src/PSRule/Rules0% | 0% | 7% | 41% | 50%
src/PSRule.Badges0% | 0% | 0% | 41% | 58%
src/PSRule/Data0% | 0% | 0% | 44% | 55%
src/PSRule.BuildTool0% | 0% | 0% | 20% | 79%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private InvokeResult ProcessTargetObject()
in src/PSRule/Pipeline/InvokeRulePipeline.cs
71 19 1
private IResource MapResource()
in src/PSRule/Common/JsonConverters.cs
68 15 2
private void RuleSummary()
in src/PSRule/Pipeline/Output/MarkdownOutputWriter.cs
67 8 1
64 7 2
protected override void ProcessRecord()
in src/PSRule/Commands/AssertWithinCommand.cs
63 22 0
protected override void ProcessRecord()
in src/PSRule/Commands/InvokeRuleBlockCommand.cs
56 9 0
protected override PipelineReader PrepareReader()
in src/PSRule/Pipeline/GetTargetPipeline.cs
53 9 0
protected override PipelineReader PrepareReader()
in src/PSRule/Pipeline/InvokeRulePipeline.cs
53 9 0
private bool Link()
in src/PSRule/Parser/MarkdownReader.cs
52 9 0
private static PSObject ReadObject()
in src/PSRule/Common/JsonConverters.cs
50 16 3
protected static bool GetField()
in src/PSRule/Commands/RuleKeyword.cs
47 11 4
private static string UnwrapStyleMarkers()
in src/PSRule/Parser/MarkdownReader.cs
47 17 2
private static string DetectLinePrefix()
in src/PSRule/Runtime/Assert.cs
47 36 1
private static void RunDebug()
in src/PSRule.Benchmark/Program.cs
46 14 0
protected override void ProcessRecord()
in src/PSRule/Commands/InvokeConventionCommand.cs
45 7 0
private void MapProperty()
in src/PSRule/Common/JsonConverters.cs
45 12 3
44 3 2
public override void End()
in src/PSRule/Pipeline/AssertPipeline.cs
43 12 0
public static IEnumerable ConvertFromYaml()
in src/PSRule/Pipeline/PipelineReciever.cs
43 9 2
protected override void ProcessRecord()
in src/PSRule/Commands/AssertExistsCommand.cs
42 10 0