microsoft / microsoft-r-open
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 7,694 units with 198,396 lines of code in units (18.3% of code).
    • 110 very complex units (29,180 lines of code)
    • 255 complex units (29,359 lines of code)
    • 906 medium complex units (48,448 lines of code)
    • 1,238 simple units (34,296 lines of code)
    • 5,185 very simple units (57,113 lines of code)
14% | 14% | 24% | 17% | 28%
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
c14% | 15% | 24% | 17% | 27%
R14% | 14% | 24% | 16% | 31%
pl0% | 73% | 0% | 0% | 26%
h0% | 7% | 27% | 13% | 51%
m0% | 0% | 41% | 35% | 23%
java0% | 0% | 100% | 0% | 0%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
source/src14% | 14% | 24% | 17% | 28%
additionalPackages/doParallel0% | 31% | 34% | 8% | 26%
source/tools0% | 62% | 15% | 0% | 22%
additionalPackages/RevoIOQ0% | 0% | 8% | 14% | 77%
additionalPackages/RevoMods0% | 0% | 65% | 0% | 34%
additionalPackages/RevoUtils0% | 0% | 47% | 0% | 52%
source/doc0% | 0% | 0% | 42% | 57%
source/share0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
SEXP attribute_hidden do_dotCode()
in source/src/main/dotcode.c
1039 213 4
do_install_source <- function()
in source/src/library/tools/R/install.R
663 205 4
get_exclude_patterns <- function()
in source/src/library/tools/R/build.R
815 143 0
static void deparse2buff()
in source/src/main/deparse.c
506 143 2
SEXP attribute_hidden do_strsplit()
in source/src/main/grep.c
442 141 4
strOptions <- function()
in source/src/library/utils/R/str.R
420 138 5
SEXP attribute_hidden do_gsub()
in source/src/main/grep.c
391 136 4
SEXP attribute_hidden do_summary()
in source/src/main/summary.c
346 130 4
static SEXP bcEval()
in source/src/main/eval.c
883 125 3
static void worker_input_handler()
in source/src/modules/internet/Rhttpd.c
279 111 1
SEXP attribute_hidden do_sprintf()
in source/src/main/sprintf.c
333 110 4
SEXP C_axis()
in source/src/library/graphics/src/plot.c
416 107 1
SEXP attribute_hidden do_options()
in source/src/main/options.c
294 105 4
escapeAmpersand <- function()
in source/src/library/tools/R/Rd2HTML.R
603 103 1
SEXP attribute_hidden do_regexpr()
in source/src/main/grep.c
287 101 4
arima <- function()
in source/src/library/stats/R/arima.R
322 100 4
static void vector2buff()
in source/src/main/deparse.c
174 95 2
static void inspect_tree()
in source/src/main/inspect.c
151 95 4
static int SubassignTypeFix()
in source/src/main/subassign.c
146 92 6
SEXP attribute_hidden do_grep()
in source/src/main/grep.c
219 91 4