aws-robotics / health-metrics-collector-ros1
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 14 units with 135 lines of code in units (43.5% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 2 medium size units (53 lines of code)
    • 1 small units (18 lines of code)
    • 11 very small units (64 lines of code)
0% | 0% | 39% | 13% | 47%
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% | 14% | 44%
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% | 14% | 44%
include/health_metric_collector0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 14 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
void CPUMetricCollector::CollectCpuUsage()
in health_metric_collector/src/cpu_metric_collector.cpp
18 2 2
void CPUMetricCollector::Collect()
in health_metric_collector/src/cpu_metric_collector.cpp
10 2 0
void SysInfoCollector::Collect()
in health_metric_collector/src/sys_info_collector.cpp
9 1 0
void SysInfoCollector::AddMetric()
in health_metric_collector/src/sys_info_collector.cpp
9 1 3
MetricData ros_monitoring_msgs::MetricManager::CreateMetric()
in health_metric_collector/src/metric_manager.cpp
8 1 0
void ros_monitoring_msgs::MetricManager::AddDimension()
in health_metric_collector/src/metric_manager.cpp
8 1 2
void operator()
in health_metric_collector/include/health_metric_collector/collect_and_publish.h
7 2 0
void ros_monitoring_msgs::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 ros_monitoring_msgs::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