microsoft / Application-Insights-Istio-Adapter
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 125 units with 2,518 lines of code in units (70.0% of code).
    • 2 very long units (359 lines of code)
    • 5 long units (351 lines of code)
    • 34 medium size units (1,069 lines of code)
    • 28 small units (428 lines of code)
    • 56 very small units (311 lines of code)
14% | 13% | 42% | 16% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs14% | 13% | 42% | 16% | 12%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/LibraryTest/Library28% | 10% | 43% | 10% | 6%
src/Library0% | 21% | 38% | 26% | 13%
src/ConsoleHost0% | 83% | 0% | 16% | 0%
src/LibraryTest/Library/Inputs0% | 0% | 71% | 12% | 16%
src/Library/Inputs/GrpcInput0% | 0% | 63% | 17% | 18%
src/LibraryTest0% | 0% | 45% | 13% | 40%
src/Common0% | 0% | 32% | 29% | 38%
src/LibraryTest/Common0% | 0% | 0% | 100% | 0%
src/Library/Inputs0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
203 1 0
156 1 0
public IEnumerable Generate()
in src/Library/TelemetryGenerator.cs
90 21 1
82 1 0
public Library()
in src/Library/Library.cs
70 7 1
public void TelemetryGeneratorTests_TcpExternalDependencyIsHandledCorrectly()
in src/LibraryTest/Library/TelemetryGeneratorTests.cs
55 1 0
static void Main()
in src/ConsoleHost/Program.cs
54 7 1
49 1 0
public void TelemetryGeneratorTests_HandlesEmptyTargetNamespacesCorrectly()
in src/LibraryTest/Library/TelemetryGeneratorTests.cs
46 1 0
public void TelemetryGeneratorTests_HandlesTargetNamespacesCorrectly()
in src/LibraryTest/Library/TelemetryGeneratorTests.cs
44 1 0
internal void ListenerCallbackAsync()
in src/Library/ClusterInfoListener.cs
43 5 1
private RequestTelemetry GenerateRequest()
in src/Library/TelemetryGenerator.cs
42 7 23
public void ConfigurationTests_EnvironmentVariablesAreResolved()
in src/LibraryTest/Library/ConfigurationTests.cs
39 1 0
public void ConfigurationTests_DefaultConfigurationIsCorrect()
in src/LibraryTest/Library/ConfigurationTests.cs
37 1 0
public void LibraryTests_LibraryCleansUpInputWhileStopping()
in src/LibraryTest/Library/LibraryTests.cs
36 2 0
public async Task HostTests_StopsLibrary()
in src/LibraryTest/Library/HostTests.cs
35 1 0
34 1 0
public bool UpdateClusterId()
in src/Library/HeartbeatCustomizer.cs
33 5 1
public async Task HostTests_RunsLibrary()
in src/LibraryTest/Library/HostTests.cs
33 1 0
public void Start()
in src/Library/Inputs/GrpcInput/GrpcInput.cs
32 3 0