GerritCodeReview / plugins_code-owners
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 3,158 units with 38,752 lines of code in units (76.2% of code).
    • 12 very long units (1,579 lines of code)
    • 52 long units (3,338 lines of code)
    • 462 medium size units (13,916 lines of code)
    • 651 small units (9,438 lines of code)
    • 1,981 very small units (10,481 lines of code)
4% | 8% | 35% | 24% | 27%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
java3% | 8% | 36% | 24% | 26%
js12% | 3% | 25% | 21% | 35%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
java/com/google/gerrit/plugins/codeowners/restapi26% | 3% | 20% | 24% | 25%
javatests/com/google/gerrit/plugins/codeowners/acceptance2% | 13% | 47% | 23% | 12%
java/com/google/gerrit/plugins/codeowners/backend5% | 11% | 31% | 19% | 32%
ui12% | 3% | 25% | 21% | 35%
java/com/google/gerrit/plugins/codeowners/validation27% | 25% | 10% | 25% | 11%
javatests/com/google/gerrit/plugins/codeowners/backend0% | 4% | 34% | 28% | 32%
javatests/com/google/gerrit/plugins/codeowners/restapi0% | 16% | 36% | 23% | 24%
java/com/google/gerrit/plugins/codeowners/api0% | 0% | 22% | 25% | 51%
java/com/google/gerrit/plugins/codeowners/testing0% | 0% | 6% | 5% | 87%
java/com/google/gerrit/plugins/codeowners/acceptance0% | 0% | 10% | 32% | 56%
java/com/google/gerrit/plugins/codeowners/common0% | 0% | 0% | 14% | 85%
javatests/com/google/gerrit/plugins/codeowners/util0% | 0% | 0% | 0% | 100%
java/com/google/gerrit/plugins/codeowners/metrics0% | 0% | 0% | 0% | 100%
java/com/google/gerrit/plugins/codeowners/util0% | 0% | 0% | 0% | 100%
java/com/google/gerrit/plugins/codeowners/module0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static get template()
in ui/suggest-owners.js
248 1 0
public Response apply()
in java/com/google/gerrit/plugins/codeowners/restapi/CheckCodeOwner.java
180 25 1
public Response apply()
in java/com/google/gerrit/plugins/codeowners/restapi/PutCodeOwnerProjectConfig.java
148 21 2
public void getWithDefaultAndGlobalCodeOwnersAndLimit()
in javatests/com/google/gerrit/plugins/codeowners/acceptance/api/AbstractGetCodeOwnersForPathIT.java
126 1 0
public void getStatusWithStart()
in javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnerStatusIT.java
125 1 0
protected Response applyImpl()
in java/com/google/gerrit/plugins/codeowners/restapi/AbstractGetCodeOwnersForPath.java
121 12 1
private Optional buildMessageForCodeOwnerApproval()
in java/com/google/gerrit/plugins/codeowners/backend/OnCodeOwnerApproval.java
111 17 7
private PathCodeOwnerStatus getPathCodeOwnerStatus()
in java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerApprovalCheck.java
108 13 11
private Optional validateCodeOwnerConfigReference()
in java/com/google/gerrit/plugins/codeowners/validation/CodeOwnerConfigValidator.java
106 12 6
private Optional validateCodeOwnerConfig()
in java/com/google/gerrit/plugins/codeowners/validation/CodeOwnerConfigValidator.java
103 10 5
public void getStatusWithLimit()
in javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnerStatusIT.java
102 1 0
private Stream getFileStatuses()
in java/com/google/gerrit/plugins/codeowners/backend/CodeOwnerApprovalCheck.java
101 8 3
public void getOwnedPathsForRenamedFilesWithLimit()
in javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetOwnedPathsIT.java
99 1 0
public void checkCodeOwnerFromImportedPerFileConfig()
in javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CheckCodeOwnerIT.java
94 1 0
public void filterByEmail()
in javatests/com/google/gerrit/plugins/codeowners/acceptance/api/GetCodeOwnerConfigFilesIT.java
91 1 0
private void testGetFromDiffCacheReturnsChangedFilesSortedByPathForMerge()
in javatests/com/google/gerrit/plugins/codeowners/backend/ChangedFilesTest.java
90 3 1
public OptionalResultWithMessages resolveCodeOwnerConfig()
in java/com/google/gerrit/plugins/codeowners/backend/PathCodeOwners.java
88 6 0
public void debugLogsContainUnresolvedImports()
in javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CheckCodeOwnerIT.java
82 1 0
public void checkCodeOwnerWithAnnotations()
in javatests/com/google/gerrit/plugins/codeowners/acceptance/api/CheckCodeOwnerIT.java
82 1 0
private void testGetCodeOwnersWithDebug()
in javatests/com/google/gerrit/plugins/codeowners/acceptance/api/AbstractGetCodeOwnersForPathIT.java
79 1 0