microsoft / xbox-live-trace-analyzer
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 202 units with 3,419 lines of code in units (66.4% of code).
    • 3 very long units (369 lines of code)
    • 13 long units (809 lines of code)
    • 36 medium size units (1,116 lines of code)
    • 39 small units (541 lines of code)
    • 111 very small units (584 lines of code)
10% | 23% | 32% | 15% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs14% | 26% | 28% | 15% | 14%
js0% | 14% | 44% | 16% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Source/RulesEngine17% | 18% | 33% | 18% | 11%
Source86% | 0% | 0% | 9% | 3%
Source/Rules0% | 41% | 23% | 11% | 23%
Source/html-report/js0% | 14% | 44% | 16% | 25%
Source/Reports0% | 45% | 33% | 13% | 7%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public static ServiceCallItem FromJson()
in Source/RulesEngine/ServiceCallItem.cs
133 32 1
public static ServiceCallItem FromFiddlerFrame()
in Source/RulesEngine/ServiceCallItem.cs
121 15 5
static bool ParseArguments()
in Source/AnalyzerMain.cs
115 24 1
build: function()
in Source/html-report/js/report_builder.js
76 7 2
public static bool IsAnalyzedService()
in Source/RulesEngine/Utils.cs
75 14 2
public override RuleResult Run()
in Source/Rules/BatchFrequencyRule.cs
72 12 2
private void ConvertCS2ToEvent()
in Source/RulesEngine/ServiceCallData.cs
72 14 1
override public RuleResult Run()
in Source/Rules/CallFrequencyRule.cs
66 15 2
public void RunReport()
in Source/Reports/CallReport.cs
61 10 3
public override RuleResult Run()
in Source/Rules/ThrottledCallsRule.cs
59 10 2
public JObject ReportRule()
in Source/Reports/PerEndpointJsonReport.cs
58 10 1
public void LoadRules()
in Source/RulesEngine/TraceAnalyzer.cs
57 13 1
public void DeserializeFiddlerTrace()
in Source/RulesEngine/ServiceCallData.cs
55 10 2
build: function()
in Source/html-report/js/report_builder.js
54 4 1
public override RuleResult Run()
in Source/Rules/SmallBatchDetectionRule.cs
53 9 2
override public RuleResult Run()
in Source/Rules/RepeatedCallsRule.cs
51 11 2
function StatsPage()
in Source/html-report/js/report_builder.js
50 1 0
public override RuleResult Run()
in Source/Rules/PollingDetectionRule.cs
48 11 2
private void ConvertCS1ToEvent()
in Source/RulesEngine/ServiceCallData.cs
46 9 1
public static void PrintCallIdRange()
in Source/RulesEngine/Utils.cs
45 8 3