facebookresearch / lightweight-inference-compilation
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 168 units with 1,083 lines of code in units (49.3% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (61 lines of code)
    • 6 medium size units (239 lines of code)
    • 16 small units (234 lines of code)
    • 145 very small units (549 lines of code)
0% | 5% | 22% | 21% | 50%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 5% | 22% | 21% | 50%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/lic/ppl/inference0% | 23% | 11% | 20% | 44%
src/lic/ppl/world0% | 0% | 22% | 18% | 59%
src/lic/ppl/experimental/inference_compilation0% | 0% | 32% | 38% | 29%
src/lic/ppl/inference/proposer0% | 0% | 51% | 0% | 48%
src/lic/ppl/model0% | 0% | 0% | 42% | 57%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
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 update_graph()
in src/lic/ppl/world/world.py
46 12 2
def update_children_parents()
in src/lic/ppl/world/world.py
43 17 2
def get_default_transforms()
in src/lic/ppl/world/utils.py
39 12 1
def propose()
in src/lic/ppl/inference/proposer/abstract_single_site_single_step_proposer.py
32 3 3
def single_inference_run()
in src/lic/ppl/inference/abstract_mh_infer.py
29 1 3
def _build_node_embedding_network()
in src/lic/ppl/experimental/inference_compilation/ic_infer.py
20 1 2
def __str__()
in src/lic/ppl/world/world.py
18 3 1
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 _verify_queries()
in src/lic/ppl/inference/abstract_infer.py
17 6 1
def random_variable()
in src/lic/ppl/model/statistical_model.py
16 3 1
def compile()
in src/lic/ppl/experimental/inference_compilation/ic_infer.py
15 1 5
def _build_node_proposal_param_network()
in src/lic/ppl/experimental/inference_compilation/ic_infer.py
14 2 2
def process_blocks()
in src/lic/ppl/inference/abstract_mh_infer.py
14 5 1
def __init__()
in src/lic/ppl/world/world.py
13 2 1
def copy()
in src/lic/ppl/world/variable.py
13 1 1
def single_inference_run_with_sequential_block_update()
in src/lic/ppl/inference/abstract_mh_infer.py
13 1 2
def get_markov_blanket()
in src/lic/ppl/world/world.py
12 5 2