corretto / corretto-8
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 225,113 units with 2,408,899 lines of code in units (66.4% of code).
    • 1,656 very long units (308,233 lines of code)
    • 4,968 long units (336,959 lines of code)
    • 19,178 medium size units (591,240 lines of code)
    • 30,265 small units (438,772 lines of code)
    • 169,046 very small units (733,695 lines of code)
12% | 13% | 24% | 18% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java10% | 12% | 24% | 19% | 33%
cpp18% | 18% | 27% | 17% | 18%
c33% | 30% | 22% | 8% | 5%
h23% | 3% | 13% | 3% | 55%
m19% | 16% | 37% | 14% | 12%
hpp<1% | 1% | 5% | 11% | 81%
js0% | 6% | 20% | 28% | 43%
cc0% | 72% | 10% | 14% | 3%
pl0% | 87% | 0% | 0% | 12%
cs0% | 0% | 76% | 0% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/jdk13% | 14% | 25% | 18% | 27%
src/hotspot14% | 15% | 23% | 16% | 29%
src/jaxp14% | 13% | 24% | 16% | 30%
src/jaxws7% | 9% | 21% | 17% | 43%
src/langtools6% | 11% | 24% | 21% | 36%
src/corba5% | 10% | 27% | 21% | 35%
src/nashorn5% | 10% | 21% | 19% | 43%
src/common0% | 53% | 0% | 40% | 6%
src/make0% | 87% | 0% | 0% | 12%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static
in src/jdk/src/share/classes/sun/nio/cs/ext/IBM964.java
5702 1 0
static
in src/jdk/src/share/classes/sun/nio/cs/ext/IBM964.java
4452 1 0
static
in src/jdk/src/share/classes/sun/nio/cs/ext/IBM33722.java
4380 1 0
static
in src/jdk/src/share/classes/sun/nio/cs/ext/IBM33722.java
2252 1 0
public final Symbol parser_do_action()
in src/jaxp/src/com/sun/org/apache/xalan/internal/xsltc/compiler/XPathParser.java
1309 210 4
static
in src/jdk/src/solaris/classes/sun/awt/X11/XKeysym.java
1293 1 0
protected void initComponentDefaults()
in src/jdk/src/share/classes/javax/swing/plaf/basic/BasicLookAndFeel.java
1256 1 1
protected void initComponentDefaults()
in src/jdk/src/share/classes/com/sun/java/swing/plaf/windows/WindowsLookAndFeel.java
1135 7 1
void ClassVerifier::verify_method()
in src/hotspot/src/share/vm/classfile/verifier.cpp
1039 269 2
protected void initComponentDefaults()
in src/jdk/src/share/classes/javax/swing/plaf/metal/MetalLookAndFeel.java
980 4 1
protected void initComponentDefaults()
in src/jdk/src/share/classes/com/sun/java/swing/plaf/motif/MotifLookAndFeel.java
977 1 1
public ExtendedCharsets()
in src/jdk/src/share/classes/sun/nio/cs/ext/ExtendedCharsets.java
924 1 0
protected void initComponentDefaults()
in src/jdk/src/share/classes/com/sun/java/swing/plaf/gtk/GTKLookAndFeel.java
917 4 1
public void accept()
in src/jaxws/src/share/jaxws_classes/com/sun/xml/internal/ws/org/objectweb/asm/ClassReader.java
896 224 3
mlib_status mlib_convMxN_Index3_8_8nw()
in src/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageConv_8nw.c
851 78 9
private final int jjMoveNfa_0()
in src/jaxws/src/share/jaxws_classes/com/sun/xml/internal/xsom/impl/scd/SCDParserTokenManager.java
843 395 2
void Parse::do_one_bytecode()
in src/hotspot/src/share/vm/opto/parse2.cpp
824 234 0
void SharkBlock::parse_bytecode()
in src/hotspot/src/share/vm/shark/sharkBlock.cpp
793 240 2
mlib_status mlib_convMxN_Index3_8_16nw()
in src/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageConvIndex3_8_16nw.c
715 66 9
mlib_status mlib_convMxN_Index3_8_8nw()
in src/jdk/src/solaris/native/sun/awt/medialib/mlib_v_ImageConvIndex3_8_8nw.c
715 66 9