facebookresearch / lightweight-inference-compilation
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 168 units with 1,083 lines of code in units (49.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 4 medium complex units (189 lines of code)
    • 5 simple units (113 lines of code)
    • 159 very simple units (781 lines of code)
0% | 0% | 17% | 10% | 72%
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
py0% | 0% | 17% | 10% | 72%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/lic/ppl/world0% | 0% | 22% | 6% | 71%
src/lic/ppl/inference0% | 0% | 23% | 10% | 66%
src/lic/ppl/experimental/inference_compilation0% | 0% | 0% | 32% | 67%
src/lic/ppl/inference/proposer0% | 0% | 0% | 0% | 100%
src/lic/ppl/model0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def update_children_parents()
in src/lic/ppl/world/world.py
43 17 2
def update_graph()
in src/lic/ppl/world/world.py
46 12 2
def get_default_transforms()
in src/lic/ppl/world/utils.py
39 12 1
def block_propose_change()
in src/lic/ppl/inference/abstract_mh_infer.py
61 11 2
def _proposer_func_for_node()
in src/lic/ppl/experimental/inference_compilation/ic_infer.py
50 9 2
def set_transform()
in src/lic/ppl/world/variable.py
18 8 3
def __post_init__()
in src/lic/ppl/world/variable.py
17 7 1
def initialize_world()
in src/lic/ppl/inference/abstract_infer.py
11 7 3
def _verify_queries()
in src/lic/ppl/inference/abstract_infer.py
17 6 1
def get_markov_blanket()
in src/lic/ppl/world/world.py
12 5 2
def process_blocks()
in src/lic/ppl/inference/abstract_mh_infer.py
14 5 1
def is_marked_for_delete()
in src/lic/ppl/world/diff_stack.py
6 4 2
def get_node()
in src/lic/ppl/world/diff_stack.py
6 4 2
def push_changes()
in src/lic/ppl/world/diff_stack.py
12 4 2
def get_chain()
in src/lic/ppl/inference/monte_carlo_samples.py
9 4 2
def ensure_1d()
in src/lic/ppl/experimental/inference_compilation/utils.py
11 3 1
def __str__()
in src/lic/ppl/world/world.py
18 3 1
def compute_score()
in src/lic/ppl/world/world.py
9 3 2
def __init__()
in src/lic/ppl/world/diff_stack.py
8 3 2
def get_node_earlier_version()
in src/lic/ppl/world/diff_stack.py
7 3 2