GerritCodeReview / bazlets
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 23 units with 327 lines of code in units (15.8% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (72 lines of code)
    • 3 medium size units (76 lines of code)
    • 7 small units (106 lines of code)
    • 12 very small units (73 lines of code)
0% | 22% | 23% | 32% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 26% | 18% | 34% | 20%
java0% | 0% | 45% | 23% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
tools/eclipse0% | 60% | 0% | 16% | 23%
tools/js0% | 0% | 100% | 0% | 0%
lib/prolog/java0% | 0% | 45% | 23% | 30%
tools/sonar0% | 0% | 0% | 93% | 6%
tools0% | 0% | 0% | 56% | 43%
tools/maven0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def gen_classpath()
in tools/eclipse/project.py
72 26 1
def main()
in tools/js/run_npm_binary.py
27 7 1
private static void add()
in lib/prolog/java/PrologCompiler.java
25 5 3
def extract()
in tools/js/run_npm_binary.py
24 8 3
def find_bazel()
in tools/eclipse/project.py
20 5 0
def get_plugin_version()
in tools/sonar/gen_sonar_project_properties.py
17 5 1
def download_properties()
in tools/download_file.py
16 7 1
def resolve_url()
in tools/util.py
14 4 2
private static void jar()
in lib/prolog/java/PrologCompiler.java
13 2 2
def guess_maven_group_id()
in tools/sonar/gen_sonar_project_properties.py
13 7 2
def generate_project_properties()
in tools/sonar/gen_sonar_project_properties.py
13 2 4
public static void main()
in lib/prolog/java/PrologCompiler.java
10 2 1
def safe_mkdirs()
in tools/download_file.py
8 4 1
def hash_file()
in tools/util.py
8 3 2
def _query_classpath()
in tools/eclipse/project.py
8 3 0
private static File tmpdir()
in lib/prolog/java/PrologCompiler.java
7 3 1
def cache_entry()
in tools/download_file.py
7 2 1
def _build_bazel_cmd()
in tools/eclipse/project.py
7 3 1
def excluded()
in tools/eclipse/project.py
6 4 1
def gen_project()
in tools/eclipse/project.py
5 1 2