microsoft / git
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 10,336 units with 228,267 lines of code in units (31.7% of code).
    • 71 very complex units (16,707 lines of code)
    • 184 complex units (20,917 lines of code)
    • 1,063 medium complex units (56,334 lines of code)
    • 1,809 simple units (52,600 lines of code)
    • 7,209 very simple units (81,709 lines of code)
7% | 9% | 24% | 23% | 35%
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
c7% | 8% | 25% | 22% | 35%
pm11% | 1% | 19% | 27% | 39%
perl3% | 17% | 19% | 24% | 35%
py11% | 7% | 26% | 16% | 37%
h0% | 0% | 14% | 15% | 70%
go0% | 0% | 7% | 38% | 53%
pl0% | 0% | 0% | 18% | 81%
t0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ROOT5% | 9% | 25% | 22% | 36%
builtin12% | 12% | 26% | 20% | 27%
perl13% | 1% | 22% | 21% | 40%
sha1dc50% | 0% | 3% | 2% | 44%
compat5% | 3% | 18% | 27% | 45%
t2% | 3% | 28% | 26% | 39%
xdiff6% | 16% | 30% | 25% | 19%
gitweb0% | 16% | 24% | 22% | 36%
contrib0% | 5% | 13% | 39% | 41%
refs0% | 7% | 31% | 22% | 38%
reftable0% | 3% | 13% | 33% | 49%
trace20% | 0% | 14% | 7% | 78%
negotiator0% | 0% | 11% | 22% | 65%
ewah0% | 0% | 0% | 44% | 55%
ppc0% | 0% | 0% | 45% | 54%
sha2560% | 0% | 0% | 13% | 86%
block-sha10% | 0% | 0% | 17% | 82%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
int cmd_rebase()
in builtin/rebase.c
690 166 3
360 155 6
sub read_all_remotes()
in perl/Git/SVN.pm
778 151 0
void ubc_check()
in sha1dc/ubc_check.c
263 129 2
int cmd_rev_parse()
in builtin/rev-parse.c
407 127 3
int cmd_merge()
in builtin/merge.c
352 114 3
int err_win_to_posix()
in compat/mingw.c
118 112 1
static int dowild()
in wildmatch.c
182 107 3
int cmd_format_patch()
in builtin/log.c
423 104 3
int cmd_clone()
in builtin/clone.c
345 101 3
300 94 3
290 90 2
97 90 1
279 88 5
int cmd_config()
in builtin/config.c
290 85 3
int cmd_rev_list()
in builtin/rev-list.c
230 85 3
int start_command()
in run-command.c
274 85 1
int send_pack()
in send-pack.c
229 85 5
242 83 3
int cmd_index_pack()
in builtin/index-pack.c
207 82 3