facebookresearch / SAFEtorch
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 183 lines of code in units (80.3% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 3 medium size units (84 lines of code)
    • 3 small units (47 lines of code)
    • 8 very small units (52 lines of code)
0% | 0% | 45% | 25% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 0% | 45% | 25% | 28%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
safetorch0% | 0% | 85% | 0% | 14%
utils0% | 0% | 26% | 38% | 35%
Alternative Visuals
Longest Units
Top 14 longest units
Unit# linesMcCabe index# params
def filter_memory_references()
in utils/capstone_disassembler.py
32 9 1
def __init__()
in safetorch/safe_network.py
29 1 2
def forward()
in safetorch/safe_network.py
23 4 3
def disassemble()
in utils/capstone_disassembler.py
20 6 4
def __init__()
in utils/radare_analyzer.py
15 1 2
def convert_to_ids()
in utils/instructions_converter.py
12 5 2
def normalize_function_pairs()
in utils/function_normalizer.py
9 2 2
def __init__()
in safetorch/parameters.py
9 2 1
def get_functions()
in utils/radare_analyzer.py
8 4 1
def normalize_functions()
in utils/function_normalizer.py
8 2 2
def get_hexasm()
in utils/radare_analyzer.py
6 2 2
def normalize()
in utils/function_normalizer.py
6 2 2
def __init__()
in utils/instructions_converter.py
4 1 2
def __init__()
in utils/function_normalizer.py
2 1 2