bazelbuild / rules_scala
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 138 units with 1,770 lines of code in units (22.9% of code).
    • 0 very long units (0 lines of code)
    • 4 long units (272 lines of code)
    • 18 medium size units (597 lines of code)
    • 33 small units (481 lines of code)
    • 83 very small units (420 lines of code)
0% | 15% | 33% | 27% | 23%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
scala0% | 30% | 19% | 29% | 20%
java0% | 4% | 43% | 25% | 25%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
scala0% | 48% | 19% | 20% | 11%
src0% | 8% | 36% | 28% | 26%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private def getTestsuite()
in scala/support/JUnitXmlReporter.scala
98 56 2
def run()
in src/scala/io/bazel/rules_scala/scrooge_support/Compiler.scala
70 12 0
private def idxAdjustmentForRecordedEvents()
in scala/support/JUnitXmlReporter.scala
52 28 1
private static void persistentWorkerMain()
in src/java/io/bazel/rulesscala/worker/Worker.java
52 7 1
def work()
in src/scala/scripts/ScroogeWorker.scala
43 3 1
private static void compileScalaSources()
in src/java/io/bazel/rulesscala/scalac/ScalacWorker.java
43 8 3
private SimpleFileVisitor createInstrumenterVisitor()
in src/java/io/bazel/rulesscala/coverage/instrumenter/JacocoInstrumenter.java
43 4 3
public void addDirectory()
in src/java/io/bazel/rulesscala/jar/JarCreator.java
42 7 1
protected void copyEntry()
in src/java/io/bazel/rulesscala/jar/JarHelper.java
41 11 3
private def generateJmhBenchmark()
in src/scala/io/bazel/rules_scala/jmh_support/BenchmarkGenerator.scala
40 4 5
private def locateSuite()
in scala/support/JUnitXmlReporter.scala
38 10 2
private void processArg()
in src/java/io/bazel/rulesscala/coverage/instrumenter/JacocoInstrumenter.java
36 3 2
public static void main()
in src/java/io/bazel/rulesscala/exe/LauncherFileWriter.java
35 1 1
public static void buildJar()
in src/java/io/bazel/rulesscala/jar/JarCreator.java
34 6 1
public CompileOptions()
in src/java/io/bazel/rulesscala/scalac/CompileOptions.java
32 1 1
public void work()
in src/java/io/bazel/rulesscala/scalac/ScalacWorker.java
32 8 1
private static List extractJar()
in src/java/io/bazel/rulesscala/scalac/ScalacWorker.java
26 5 3
def main()
in scala/scalafmt/scalafmt/ScalafmtWorker.scala
23 4 1
protected void writeEntry()
in src/java/io/bazel/rulesscala/jar/JarHelper.java
23 4 3
private static void deleteRecursively()
in src/java/io/bazel/rulesscala/scalac/ScalacWorker.java
23 3 1