bazelbuild / rules_closure
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 518 units with 5,233 lines of code in units (42.6% of code).
    • 4 very long units (469 lines of code)
    • 3 long units (208 lines of code)
    • 51 medium size units (1,467 lines of code)
    • 83 small units (1,168 lines of code)
    • 377 very small units (1,921 lines of code)
8% | 3% | 28% | 22% | 36%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java9% | 4% | 27% | 22% | 36%
js0% | 0% | 59% | 8% | 32%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
java/com32% | 12% | 15% | 19% | 20%
java/io5% | 5% | 38% | 20% | 30%
java/org53% | 0% | 34% | 0% | 11%
javatests/io0% | 0% | 18% | 29% | 51%
closure/testing0% | 0% | 59% | 8% | 32%
javatests/org0% | 0% | 0% | 32% | 67%
javatests/com0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private boolean run()
in java/com/google/javascript/jscomp/JsChecker.java
142 29 0
private int run()
in java/com/google/javascript/jscomp/JsCompiler.java
113 32 1
public static HttpRequest readHttpRequest()
in java/io/bazel/rules/closure/http/HttpParser.java
109 36 1
private void emitClosingTagIfRequiredByHtml5()
in java/org/jsoup/nodes/Html5Printer.java
105 58 1
private String format()
in java/com/google/javascript/jscomp/JsCheckerErrorFormatter.java
94 20 2
private int run()
in java/io/bazel/rules/closure/webfiles/WebfilesValidatorProgram.java
59 11 1
public Webpath normalize()
in java/io/bazel/rules/closure/Webpath.java
55 18 0
public WebfileInfo writeWebfile()
in java/io/bazel/rules/closure/webfiles/WebfilesWriter.java
45 3 2
private void emitOpeningTagIfRequiredByHtml5()
in java/org/jsoup/nodes/Html5Printer.java
45 21 1
private void handleConnection()
in java/io/bazel/rules/closure/http/HttpServer.java
44 7 0
public static Webset load()
in java/io/bazel/rules/closure/webfiles/Webset.java
41 9 2
public void report()
in java/io/bazel/rules/closure/worker/ErrorReporter.java
39 8 2
void loadMetadataIntoObjectGraph()
in java/io/bazel/rules/closure/webfiles/server/Metadata.java
38 7 0
private int runAsPersistentWorker()
in java/io/bazel/rules/closure/worker/PersistentWorker.java
38 4 0
private void validateCss()
in java/io/bazel/rules/closure/webfiles/WebfilesValidator.java
37 3 3
public CheckLevel level()
in java/com/google/javascript/jscomp/JsCompilerWarnings.java
36 12 1
Multimap validate()
in java/io/bazel/rules/closure/webfiles/WebfilesValidator.java
35 8 3
private Vertex connectStrongly()
in java/io/bazel/rules/closure/Tarjan.java
35 9 1
function main()
in closure/testing/phantomjs_harness.js
34 3 0
public boolean equals()
in java/io/bazel/rules/closure/Webpath.java
34 14 1