pytorch / kineto
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 852 units with 9,375 lines of code in units (53.1% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (473 lines of code)
    • 32 medium complex units (1,768 lines of code)
    • 63 simple units (1,806 lines of code)
    • 755 very simple units (5,328 lines of code)
0% | 5% | 18% | 19% | 56%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
cpp0% | 10% | 16% | 23% | 49%
py0% | 0% | 28% | 20% | 51%
tsx0% | 0% | 0% | 19% | 80%
h0% | 0% | 0% | 0% | 100%
ts0% | 0% | 0% | 0% | 100%
tpp0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
libkineto/src0% | 9% | 14% | 20% | 56%
tb_plugin/torch_tb_profiler/profiler0% | 0% | 37% | 25% | 37%
tb_plugin/torch_tb_profiler0% | 0% | 19% | 12% | 67%
tb_plugin/torch_tb_profiler/io0% | 0% | 11% | 14% | 74%
tb_plugin/fe/src0% | 0% | 0% | 8% | 91%
libkineto/include0% | 0% | 0% | 0% | 100%
tb_plugin0% | 0% | 0% | 0% | 100%
libkineto/sample_programs0% | 0% | 0% | 0% | 100%
tb_plugin/fe/scripts0% | 0% | 0% | 0% | 100%
tb_plugin/torch_tb_profiler/static0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void ChromeTraceLogger::handleTraceStart()
in libkineto/src/output_json.cpp
398 30 1
bool Config::handleOption()
in libkineto/src/Config.cpp
75 27 2
def get_memory_statistics()
in tb_plugin/torch_tb_profiler/profiler/memory_parser.py
52 24 3
void EventProfilerController::profilerLoop()
in libkineto/src/EventProfilerController.cpp
127 22 0
const time_point CuptiActivityProfiler::performRunLoopStep()
in libkineto/src/CuptiActivityProfiler.cpp
79 21 2
int RoctracerActivityApi::processActivities()
in libkineto/src/RoctracerActivityApi.cpp
155 21 1
def update_node()
in tb_plugin/torch_tb_profiler/profiler/memory_parser.py
65 21 2
def calculate_gpu_utilization()
in tb_plugin/torch_tb_profiler/profiler/gpu_metrics_parser.py
65 21 5
def _parse_node()
in tb_plugin/torch_tb_profiler/profiler/event_parser.py
51 19 7
void RoctracerActivityApi::api_callback()
in libkineto/src/RoctracerActivityApi.cpp
165 17 4
def load()
in tb_plugin/torch_tb_profiler/profiler/loader.py
42 17 1
def _process_distributed_profiles()
in tb_plugin/torch_tb_profiler/profiler/loader.py
38 17 3
def parse_nodes()
in tb_plugin/torch_tb_profiler/profiler/event_parser.py
24 16 2
def _parse_step()
in tb_plugin/torch_tb_profiler/profiler/event_parser.py
31 15 3
def _generate_overview()
in tb_plugin/torch_tb_profiler/profiler/run_generator.py
96 15 1
def _preprocess_file()
in tb_plugin/torch_tb_profiler/profiler/data.py
41 15 1
void CuptiActivityProfiler::configure()
in libkineto/src/CuptiActivityProfiler.cpp
65 14 2
def __next__()
in tb_plugin/torch_tb_profiler/io/file.py
21 14 1
def _update_steps_duration()
in tb_plugin/torch_tb_profiler/profiler/event_parser.py
38 14 4
def get_gpu_metrics_data_tooltip()
in tb_plugin/torch_tb_profiler/run.py
51 13 1