microsoft / AmbariBasedHadoopExporter
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 55 units with 1,020 lines of code in units (35.9% of code).
    • 1 very long units (124 lines of code)
    • 1 long units (65 lines of code)
    • 13 medium size units (457 lines of code)
    • 14 small units (191 lines of code)
    • 26 very small units (183 lines of code)
12% | 6% | 44% | 18% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cs12% | 6% | 44% | 18% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/Core/Exporters22% | 12% | 45% | 11% | 8%
src/App/Services0% | 0% | 47% | 24% | 28%
src/Infrastructure/Providers0% | 0% | 62% | 14% | 22%
src/App0% | 0% | 100% | 0% | 0%
src/Infrastructure/Extensions0% | 0% | 51% | 21% | 26%
src/Infrastructure/Utils0% | 0% | 100% | 0% | 0%
src/Core/Extensions0% | 0% | 0% | 77% | 22%
src/App/Logging0% | 0% | 0% | 39% | 60%
src/Core/Models0% | 0% | 0% | 68% | 31%
src/App/Middlewares0% | 0% | 0% | 73% | 26%
src/Core/Configurations0% | 0% | 0% | 0% | 100%
src/Core/Utils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
protected override async Task ReportMetrics()
in src/Core/Exporters/Concrete/HdfsNameNodeExporter.cs
124 1 1
protected override async Task ReportMetrics()
in src/Core/Exporters/Concrete/YarnResourceManagerExporter.cs
65 2 1
protected override async Task ReportMetrics()
in src/Core/Exporters/Concrete/YarnNodeManagerExporter.cs
50 1 1
protected override async Task ReportMetrics()
in src/Core/Exporters/Concrete/HdfsDataNodeExporter.cs
49 1 1
public async Task ExportMetricsAsync()
in src/Core/Exporters/Concrete/BaseExporter.cs
40 2 1
internal void ReportQueueMetrics()
in src/Core/Exporters/Concrete/YarnResourceManagerExporter.cs
39 1 2
public static async Task Main()
in src/App/Program.cs
38 3 1
internal async Task RunExportersAsync()
in src/App/Services/Hosted/PrometheusExporterHostedService.cs
38 5 0
protected override async Task ReportMetrics()
in src/Core/Exporters/Concrete/HostExporter.cs
38 1 1
public PrometheusExporterHostedService()
in src/App/Services/Hosted/PrometheusExporterHostedService.cs
36 1 3
protected override async Task ReportMetrics()
in src/Core/Exporters/Concrete/ClusterExporter.cs
30 1 1
public static void AddSecretProvider()
in src/Infrastructure/Extensions/SecretConfigurationExtension.cs
27 5 2
public async Task GetResponseContentAsync()
in src/Infrastructure/Providers/Concrete/AmbariApiContentProvider.cs
25 6 1
public void ReportGauge()
in src/Infrastructure/Utils/PrometheusUtils.cs
25 5 5
public IReadOnlyDictionary GetSecretNameToValueMap()
in src/Infrastructure/Providers/Concrete/FileSecretProvider.cs
22 4 0
public LogModel()
in src/App/Logging/LogModel.cs
20 4 2
protected BaseExporter()
in src/Core/Exporters/Concrete/BaseExporter.cs
19 1 5
internal List ExportHostsMetricsAsync()
in src/Core/Exporters/Concrete/ClusterExporter.cs
17 3 1
internal async void HealthCheck()
in src/App/Services/Hosted/LivenessHostedService.cs
16 3 1
public static void AddCoreConfiguration()
in src/Core/Extensions/ServiceExtensions.cs
16 1 2