GerritCodeReview / plugins_ref-protection
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 11 units with 192 lines of code in units (63.8% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (96 lines of code)
    • 0 medium size units (0 lines of code)
    • 4 small units (62 lines of code)
    • 6 very small units (34 lines of code)
0% | 50% | 0% | 32% | 17%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 50% | 0% | 32% | 17%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
refprotection0% | 50% | 0% | 32% | 17%
Alternative Visuals
Longest Units
Top 11 longest units
Unit# linesMcCabe index# params
public void createBackup()
in src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java
96 23 2
private static String getSequentialBranch()
in src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java
20 6 2
public void onEvent()
in src/main/java/com/googlesource/gerrit/plugins/refprotection/RefUpdateListener.java
16 10 1
private boolean isNonFastForwardUpdate()
in src/main/java/com/googlesource/gerrit/plugins/refprotection/RefUpdateListener.java
14 2 2
private boolean isRefDeleted()
in src/main/java/com/googlesource/gerrit/plugins/refprotection/RefUpdateListener.java
12 2 1
static String getTimestampBranch()
in src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java
9 3 1
private ProjectResource getProjectResource()
in src/main/java/com/googlesource/gerrit/plugins/refprotection/RefUpdateListener.java
8 2 1
static String get()
in src/main/java/com/googlesource/gerrit/plugins/refprotection/BackupRef.java
6 2 2
protected void configure()
in src/main/java/com/googlesource/gerrit/plugins/refprotection/RefProtectionModule.java
4 1 0
private boolean isRelevantRef()
in src/main/java/com/googlesource/gerrit/plugins/refprotection/RefUpdateListener.java
4 3 1
private boolean isNewRef()
in src/main/java/com/googlesource/gerrit/plugins/refprotection/RefUpdateListener.java
3 1 1