GerritCodeReview / gerrit
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 27,000 units with 283,188 lines of code in units (63.4% of code).
    • 3 very complex units (718 lines of code)
    • 16 complex units (2,062 lines of code)
    • 333 medium complex units (16,949 lines of code)
    • 990 simple units (29,013 lines of code)
    • 25,658 very simple units (234,446 lines of code)
<1% | <1% | 5% | 10% | 82%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
java<1% | <1% | 5% | 9% | 83%
ts0% | 0% | 7% | 14% | 78%
py0% | 0% | 25% | 9% | 64%
go0% | 0% | 14% | 44% | 40%
pl0% | 0% | 40% | 18% | 41%
js0% | 0% | 0% | 36% | 63%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
java<1% | 1% | 9% | 15% | 72%
polygerrit-ui0% | 0% | 6% | 14% | 78%
tools0% | 0% | 16% | 23% | 60%
javatests0% | 0% | <1% | <1% | 99%
contrib0% | 0% | 19% | 18% | 61%
resources0% | 0% | 0% | 100% | 0%
lib0% | 0% | 0% | 0% | 100%
plugins0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
protected final void service()
in java/com/google/gerrit/httpd/restapi/RestApiServlet.java
423 71 2
static IntraLineDiff compute()
in java/com/google/gerrit/server/patch/IntraLineLoader.java
114 55 4
void doAuth()
in java/com/google/gerrit/httpd/auth/openid/OpenIdServiceImpl.java
181 51 2
private ChangeInfo toChangeInfoImpl()
in java/com/google/gerrit/server/change/ChangeJson.java
151 48 3
private void parseMagicBranch()
in java/com/google/gerrit/server/git/receive/ReceiveCommits.java
184 47 1
private Optional fixedCommitMessage()
in java/com/google/gerrit/server/notedb/CommitRewriter.java
177 43 2
private ImmutableList selectNewAndReplacedChangesFromMagicBranch()
in java/com/google/gerrit/server/git/receive/ReceiveCommits.java
203 43 1
protected CommitBuilder applyImpl()
in java/com/google/gerrit/server/notedb/ChangeUpdate.java
147 41 3
public SortedMap display()
in java/com/google/gerrit/server/restapi/project/ListProjects.java
117 41 1
public BatchMetaDataUpdate openUpdate()
in java/com/google/gerrit/server/git/meta/VersionedMetaData.java
158 35 4
private void sendImpl()
in java/com/google/gerrit/server/mail/send/OutgoingEmail.java
134 35 0
public Response apply()
in java/com/google/gerrit/server/restapi/change/PostReview.java
140 32 3
public Response apply()
in java/com/google/gerrit/server/restapi/project/GetAccess.java
114 31 1
public boolean updateLabel()
in java/com/google/gerrit/server/restapi/project/SetLabel.java
129 31 3
public Response apply()
in java/com/google/gerrit/server/restapi/project/CreateBranch.java
103 30 3
private void initAuthType()
in java/com/google/gerrit/pgm/init/InitAuth.java
80 29 0
public LabelType createLabel()
in java/com/google/gerrit/server/restapi/project/CreateLabel.java
95 28 3
public boolean isEmpty()
in java/com/google/gerrit/server/notedb/ChangeUpdate.java
28 26 0
public void run()
in java/com/google/gerrit/pgm/init/InitHttpd.java
102 26 0
public Predicate is()
in java/com/google/gerrit/server/query/change/ChangeQueryBuilder.java
87 25 1