aws-robotics / health-metrics-collector-ros2
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 17 units with 177 lines of code in units (50.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (74 lines of code)
    • 3 small units (42 lines of code)
    • 11 very small units (61 lines of code)
0% | 0% | 41% | 23% | 34%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp0% | 0% | 41% | 22% | 35%
py0% | 0% | 61% | 38% | 0%
h0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src0% | 0% | 41% | 22% | 35%
launch0% | 0% | 61% | 38% | 0%
include/health_metric_collector0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 17 longest units
Unit# linesMcCabe index# params
int main()
in health_metric_collector/src/collector.cpp
27 1 2
void CPUStats::ReadStatsCPU()
in health_metric_collector/src/cpu_stats.cpp
26 5 0
def generate_launch_description()
in health_metric_collector/launch/health_metric_collector.launch.py
21 1 0
void CPUMetricCollector::CollectCpuUsage()
in health_metric_collector/src/cpu_metric_collector.cpp
18 2 2
def generate_launch_description()
in health_metric_collector/launch/sample_application.launch.py
13 1 0
void SysInfoCollector::Collect()
in health_metric_collector/src/sys_info_collector.cpp
11 1 0
void CPUMetricCollector::Collect()
in health_metric_collector/src/cpu_metric_collector.cpp
10 2 0
void SysInfoCollector::AddMetric()
in health_metric_collector/src/sys_info_collector.cpp
9 1 3
MetricData MetricManager::CreateMetric()
in health_metric_collector/src/metric_manager.cpp
8 1 0
void MetricManager::AddDimension()
in health_metric_collector/src/metric_manager.cpp
7 1 2
void Publish()
in health_metric_collector/include/health_metric_collector/collect_and_publish.h
7 2 0
explicit MetricManager()
in health_metric_collector/include/health_metric_collector/metric_manager.h
7 1 3
void MetricManager::Publish()
in health_metric_collector/src/metric_manager.cpp
5 1 0
size_t CPUData::GetActiveTime()
in health_metric_collector/src/cpu_data.cpp
5 1 0
void MetricManager::AddMetric()
in health_metric_collector/src/metric_manager.cpp
1 1 1
size_t CPUData::GetIdleTime()
in health_metric_collector/src/cpu_data.cpp
1 1 0
virtual ~MetricManagerInterface()
in health_metric_collector/include/health_metric_collector/metric_manager.h
1 1 0