facebookresearch / APIsynth
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 195 units with 2,774 lines of code in units (63.0% of code).
    • 1 very long units (395 lines of code)
    • 1 long units (56 lines of code)
    • 60 medium size units (1,573 lines of code)
    • 16 small units (245 lines of code)
    • 117 very small units (505 lines of code)
14% | 2% | 56% | 8% | 18%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py14% | 2% | 56% | 8% | 18%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Synthesis_incorporation/value_search33% | 4% | 15% | 10% | 35%
Synthesis_incorporation/benchmarks0% | 0% | 97% | 2% | 0%
Synthesis_incorporation/models0% | 0% | 46% | 25% | 27%
Synthesis_incorporation0% | 0% | 100% | 0% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def add_filters_to_function_operation()
in Synthesis_incorporation/value_search/operation_filtering.py
395 124 1
def _get_predicted_values()
in Synthesis_incorporation/value_search/value_search.py
56 21 6
def tensor_flatten_pad()
in Synthesis_incorporation/models/prediction_model.py
43 12 5
def stackoverflow_19()
in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py
40 1 0
def predict_sequence()
in Synthesis_incorporation/models/prediction_model.py
39 12 7
def stackoverflow_47()
in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py
36 1 0
def is_castable()
in Synthesis_incorporation/value_search/operation_filtering.py
36 22 2
def stackoverflow_25()
in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py
35 1 0
def embed_benchmark_value()
in Synthesis_incorporation/models/prediction_model.py
34 12 2
def stackoverflow_35()
in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py
34 1 0
def stackoverflow_07()
in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py
31 1 0
def stackoverflow_14()
in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py
31 1 0
def predict_first_in_sequence()
in Synthesis_incorporation/models/prediction_model.py
30 8 6
def stackoverflow_39()
in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py
30 1 0
def stackoverflow_44()
in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py
30 1 0
def stackoverflow_49()
in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py
30 1 0
def _print_warnings()
in Synthesis_incorporation/value_search/function_operation.py
30 7 3
def stackoverflow_06()
in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py
29 1 0
def stackoverflow_23()
in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py
29 1 0
def stackoverflow_28()
in Synthesis_incorporation/benchmarks/stackoverflow_benchmarks.py
28 1 0