microsoft / azure-pipelines-agent
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 2,265 units with 46,273 lines of code in units (72.3% of code).
    • 46 very long units (8,805 lines of code)
    • 130 long units (9,044 lines of code)
    • 451 medium size units (14,121 lines of code)
    • 499 small units (7,394 lines of code)
    • 1,139 very small units (6,909 lines of code)
19% | 19% | 30% | 15% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs19% | 19% | 30% | 15% | 14%
js0% | 22% | 48% | 18% | 10%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Agent.Worker21% | 20% | 31% | 15% | 11%
src/Agent.Listener23% | 15% | 26% | 15% | 18%
src/Agent.Plugins25% | 18% | 29% | 13% | 13%
src/Agent.Sdk7% | 15% | 34% | 20% | 22%
src/Agent.PluginHost91% | 0% | 0% | 0% | 8%
src/Microsoft.VisualStudio.Services.Agent2% | 28% | 31% | 19% | 18%
release0% | 24% | 43% | 20% | 11%
src/Agent.Service0% | 30% | 39% | 8% | 22%
tools/CredScanRegexes0% | 0% | 52% | 38% | 8%
src/Misc0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public async Task GetSourceAsync()
in src/Agent.Plugins/GitSourceProvider.cs
760 163 3
public async Task GetSourceAsync()
in src/Agent.Worker/Build/GitSourceProvider.cs
628 127 3
public async Task ConfigureAsync()
in src/Agent.Listener/Configuration/ConfigurationManager.cs
357 62 1
public async Task GetSourceAsync()
in src/Agent.Plugins/TfsVCSourceProvider.cs
312 55 3
public async Task GetSourceAsync()
in src/Agent.Worker/Build/TfsVCSourceProvider.cs
298 48 3
public async Task RunAsync()
in src/Agent.Worker/TaskRunner.cs
279 57 0
private async Task StartContainerAsync()
in src/Agent.Worker/ContainerOperationProvider.cs
270 49 2
private async Task RunAsync()
in src/Agent.Listener/JobDispatcher.cs
268 25 3
internal static void WritePhase()
in src/Agent.Listener/DistributedTask.Pipelines/Yaml/TypeConverters/ConverterUtil.phases.cs
261 72 3
public async Task RunAsync()
in src/Agent.Worker/JobRunner.cs
238 30 2
internal static IStep ReadStep()
in src/Agent.Listener/DistributedTask.Pipelines/Yaml/TypeConverters/ConverterUtil.steps.cs
224 38 2
protected override async Task ProcessCommandInternalAsync()
in src/Agent.Plugins/BuildArtifact/BuildArtifactPluginV1.cs
220 45 2
private async Task DownloadLatestAgent()
in src/Agent.Listener/SelfUpdater.cs
207 32 1
private async Task RunAsync()
in src/Agent.Listener/Agent.cs
206 34 2
protected override async Task ProcessCommandInternalAsync()
in src/Agent.Plugins/PipelineArtifact/PipelineArtifactPluginV2.cs
205 32 2
public TestRunData ReadResults()
in src/Agent.Worker/TestResults/Legacy/XunitResultReader.cs
203 55 3
internal static void WriteStep()
in src/Agent.Listener/DistributedTask.Pipelines/Yaml/TypeConverters/ConverterUtil.steps.cs
189 51 3
private List ReadActualResults()
in src/Agent.Worker/TestResults/Legacy/TrxResultReader.cs
163 47 2
public async Task UploadDiagnosticLogsAsync()
in src/Agent.Worker/DiagnosticLogManager.cs
162 16 3
public async Task ExecuteCommand()
in src/Agent.Listener/Agent.cs
158 27 1