facebookresearch / aroma-paper-artifacts
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 68 units with 978 lines of code in units (52.2% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (284 lines of code)
    • 12 medium size units (362 lines of code)
    • 10 small units (131 lines of code)
    • 42 very small units (201 lines of code)
0% | 29% | 37% | 13% | 20%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 25% | 36% | 13% | 24%
java0% | 39% | 40% | 11% | 9%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/main/python0% | 25% | 36% | 13% | 24%
src/main/java0% | 40% | 41% | 12% | 6%
data0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private JSONArray getSerializedTree()
in reference/src/main/java/ConvertJava.java
90 20 2
def get_completions2()
in reference/src/main/python/similar.py
83 16 2
def get_completions3()
in reference/src/main/python/similar.py
57 16 5
def parse_args()
in reference/src/main/python/similar.py
54 1 0
public void serializeFile()
in reference/src/main/java/ConvertJava.java
50 3 2
def get_completions_via_clustering()
in reference/src/main/python/similar.py
49 12 2
def print_similar_and_completions()
in reference/src/main/python/similar.py
47 3 4
def prune_last_jd()
in reference/src/main/python/similar.py
35 8 2
def __init__()
in reference/src/main/python/similar.py
27 1 1
def get_sub_ast_aux()
in reference/src/main/python/similar.py
25 11 3
def prune_ast()
in reference/src/main/python/similar.py
24 9 2
def collect_features_as_list()
in reference/src/main/python/similar.py
21 2 3
def featurize_and_test_record()
in reference/src/main/python/similar.py
21 8 2
def setup()
in reference/src/main/python/similar.py
21 2 1
private String getLeadingOrTrailing()
in reference/src/main/java/ConvertJava.java
21 7 3
private void dumpMethodAst()
in reference/src/main/java/ConvertJava.java
21 5 2
def sample_n_records()
in reference/src/main/python/similar.py
16 5 2
private void setClassName()
in reference/src/main/java/ConvertJava.java
15 7 3
def ast_to_code_print_lines()
in reference/src/main/python/similar.py
14 10 3
def distance_set()
in reference/src/main/python/similar.py
14 5 1