GerritCodeReview / plugins_hooks
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 59 units with 509 lines of code in units (46.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 6 medium size units (166 lines of code)
    • 14 small units (188 lines of code)
    • 39 very small units (155 lines of code)
0% | 0% | 32% | 36% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java0% | 0% | 32% | 36% | 30%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
hooks0% | 0% | 32% | 36% | 30%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
public HookResult runHook()
in src/main/java/com/googlesource/gerrit/plugins/hooks/HookTask.java
47 8 0
public List onCommitReceived()
in src/main/java/com/googlesource/gerrit/plugins/hooks/CommitReceived.java
29 5 1
public void onPreMerge()
in src/main/java/com/googlesource/gerrit/plugins/hooks/Submit.java
23 3 7
protected void configure()
in src/main/java/com/googlesource/gerrit/plugins/hooks/PluginModule.java
23 1 0
public List onRefOperation()
in src/main/java/com/googlesource/gerrit/plugins/hooks/RefUpdate.java
22 4 1
HookResult submit()
in src/main/java/com/googlesource/gerrit/plugins/hooks/HookExecutor.java
22 4 3
public void addApprovals()
in src/main/java/com/googlesource/gerrit/plugins/hooks/HookArgs.java
16 7 2
public void onRevisionCreated()
in src/main/java/com/googlesource/gerrit/plugins/hooks/RevisionCreated.java
15 1 1
public void onCommentAdded()
in src/main/java/com/googlesource/gerrit/plugins/hooks/CommentAdded.java
15 1 1
public void onChangeAbandoned()
in src/main/java/com/googlesource/gerrit/plugins/hooks/ChangeAbandoned.java
14 1 1
public void addUrl()
in src/main/java/com/googlesource/gerrit/plugins/hooks/HookArgs.java
14 2 1
public void onChangeRestored()
in src/main/java/com/googlesource/gerrit/plugins/hooks/ChangeRestored.java
14 1 1
public void onChangeMerged()
in src/main/java/com/googlesource/gerrit/plugins/hooks/ChangeMerged.java
14 1 1
public String toString()
in src/main/java/com/googlesource/gerrit/plugins/hooks/HookResult.java
13 4 0
public void onHashtagsEdited()
in src/main/java/com/googlesource/gerrit/plugins/hooks/HashtagsEdited.java
13 1 1
public void onReviewersAdded()
in src/main/java/com/googlesource/gerrit/plugins/hooks/ReviewerAdded.java
13 2 1
public void onTopicEdited()
in src/main/java/com/googlesource/gerrit/plugins/hooks/TopicEdited.java
12 1 1
public void onChangeDeleted()
in src/main/java/com/googlesource/gerrit/plugins/hooks/ChangeDeleted.java
12 1 1
public void onReviewerDeleted()
in src/main/java/com/googlesource/gerrit/plugins/hooks/ReviewerDeleted.java
12 1 1
public void stop()
in src/main/java/com/googlesource/gerrit/plugins/hooks/HookExecutor.java
11 3 0