bazelbuild / intellij
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 7,675 units with 65,587 lines of code in units (62.5% of code).
    • 15 very long units (1,958 lines of code)
    • 75 long units (4,943 lines of code)
    • 511 medium size units (14,984 lines of code)
    • 1,176 small units (17,086 lines of code)
    • 5,898 very small units (26,616 lines of code)
2% | 7% | 22% | 26% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java2% | 7% | 22% | 26% | 40%
py37% | 0% | 17% | 13% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
aswb8% | 15% | 25% | 22% | 27%
base1% | 5% | 21% | 25% | 46%
java2% | 9% | 22% | 30% | 35%
plugin_dev17% | 8% | 15% | 26% | 31%
build_defs37% | 0% | 17% | 13% | 30%
javascript4% | 6% | 37% | 23% | 28%
clwb0% | 23% | 14% | 17% | 44%
cpp0% | 9% | 35% | 28% | 27%
golang0% | 11% | 23% | 37% | 28%
python0% | 7% | 28% | 28% | 34%
scala0% | 7% | 28% | 34% | 30%
kotlin0% | 0% | 34% | 27% | 38%
aspect0% | 0% | 25% | 34% | 39%
skylark0% | 0% | 13% | 41% | 45%
testing0% | 0% | 7% | 32% | 60%
dart0% | 0% | 24% | 28% | 47%
ijwb0% | 0% | 32% | 39% | 27%
common0% | 0% | 0% | 22% | 77%
sdkcompat0% | 0% | 0% | 11% | 88%
terminal0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
private void setupUi()
in aswb/src/com/google/idea/blaze/android/resources/actions/BlazeCreateResourceFileDialog.java
248 1 0
private void setupUi()
in aswb/src/com/google/idea/blaze/android/resources/actions/BlazeCreateXmlResourcePanel.java
194 1 0
private void setupUi()
in aswb/src/com/google/idea/blaze/android/resources/actions/BlazeCreateResourceDirectoryDialog.java
155 1 0
public final boolean executeTask()
in plugin_dev/src/com/google/idea/blaze/plugin/run/BuildPluginBeforeRunTaskProvider.java
142 17 4
private static TargetMapAndInterfaceState updateState()
in base/src/com/google/idea/blaze/base/sync/aspects/BlazeIdeInterfaceAspectsImpl.java
134 24 10
private void tokenize()
in base/src/com/google/idea/blaze/base/lang/buildfile/lexer/BuildLexerBase.java
131 41 0
private void calculateJavaSourceDirectories()
in java/src/com/google/idea/blaze/java/sync/source/SourceDirectoryCalculator.java
116 23 7
private void escapedStringLiteral()
in base/src/com/google/idea/blaze/base/lang/buildfile/lexer/BuildLexerBase.java
113 42 2
public void build()
in aswb/src/com/google/idea/blaze/android/run/binary/mobileinstall/MobileInstallBuildStep.java
109 15 2
public BlazeCreateResourceFileDialog()
in aswb/src/com/google/idea/blaze/android/resources/actions/BlazeCreateResourceFileDialog.java
105 14 11
def main()
in build_defs/stamp_plugin_xml.py
103 32 0
private void parseCompilerOptions()
in javascript/src/com/google/idea/blaze/typescript/BlazeTypeScriptConfig.java
102 30 1
private static TargetMapAndInterfaceState updateTargetMap()
in base/src/com/google/idea/blaze/base/sync/aspects/BlazeIdeInterfaceAspectsImpl.java
102 12 7
private JdepsState doLoadJdepsFiles()
in java/src/com/google/idea/blaze/java/sync/jdeps/JdepsFileReader.java
102 15 6
DeviceSession getDevice()
in aswb/src/com/google/idea/blaze/android/run/runner/BlazeAndroidDeviceSelector.java
102 8 7
private static ExecutableInfo getExecutableToDebug()
in golang/src/com/google/idea/blaze/golang/run/BlazeGoRunConfigurationRunner.java
99 16 1
private void run()
in base/src/com/google/idea/blaze/base/sync/ProjectUpdateSyncTask.java
97 7 1
public static void updateProjectStructure()
in aswb/src/com/google/idea/blaze/android/sync/projectstructure/BlazeAndroidProjectStructureSyncer.java
97 10 9
public static TargetIdeInfo fromProto()
in base/src/com/google/idea/blaze/base/ideinfo/TargetIdeInfo.java
88 22 2
public List getTasks()
in aswb/sdkcompat/as213/com/google/idea/blaze/android/run/runner/BlazeAndroidLaunchTasksProvider.java
87 14 3