facebookresearch / Project_FARSI
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 1,043 units with 15,088 lines of code in units (90.2% of code).
    • 4 very complex units (768 lines of code)
    • 20 complex units (2,065 lines of code)
    • 122 medium complex units (5,260 lines of code)
    • 152 simple units (2,880 lines of code)
    • 745 very simple units (4,115 lines of code)
5% | 13% | 34% | 19% | 27%
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
py5% | 13% | 34% | 19% | 27%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
design_utils4% | 9% | 22% | 20% | 42%
visualization_utils5% | 19% | 46% | 18% | 10%
data_collection39% | 0% | 29% | 0% | 31%
DSE_utils0% | 16% | 44% | 17% | 21%
SIM_utils0% | 0% | 22% | 24% | 52%
top0% | 0% | 60% | 39% | 0%
misc0% | 0% | 0% | 47% | 52%
error_handling0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def write_one_results()
in data_collection/collection_utils/what_ifs/FARSI_what_ifs.py
198 97 7
141 67 2
def get_memory_system_attr()
in design_utils/design.py
304 60 1
def plot_codesign_nav_breakdown_cross_workload()
in visualization_utils/plotting-ying.py
125 59 2
def sel_moves_based_on_dis()
in DSE_utils/hill_climbing.py
178 45 2
def sanity_check()
in design_utils/design.py
93 44 1
def select_block_to_migrate_to()
in DSE_utils/hill_climbing.py
78 42 7
def SA_design_selection()
in DSE_utils/hill_climbing.py
128 37 6
def get_compute_system_attr()
in design_utils/design.py
116 37 1
def barplot_moves()
in visualization_utils/plot.py
281 37 1
def get_budget_optimality_for_paper()
in visualization_utils/plotting.py
161 36 4
def plot_sim_data()
in visualization_utils/vis_sim.py
139 36 3
def get_transformation_design_space_size()
in DSE_utils/hill_climbing.py
43 35 7
def fork_bus()
in design_utils/des_handler.py
48 35 4
def cluster_pipes()
in design_utils/components/hardware.py
59 34 1
def plot_convergence_per_workloads_for_paper()
in visualization_utils/plotting.py
127 32 2
def plot_convergence_per_workloads()
in visualization_utils/plotting.py
130 32 2
def apply_move()
in design_utils/des_handler.py
100 30 3
def populate_system_improvement_log()
in design_utils/des_handler.py
76 29 1
28 29 7