microsoft / microsoft-r-open
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 7,694 units with 198,396 lines of code in units (18.3% of code).
    • 294 very long units (55,249 lines of code)
    • 602 long units (41,651 lines of code)
    • 1,693 medium size units (53,928 lines of code)
    • 1,869 small units (27,470 lines of code)
    • 3,236 very small units (20,098 lines of code)
27% | 20% | 27% | 13% | 10%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c27% | 22% | 27% | 13% | 9%
R31% | 17% | 25% | 15% | 10%
pl73% | 0% | 0% | 7% | 18%
h0% | 13% | 31% | 24% | 30%
m0% | 30% | 38% | 16% | 14%
java0% | 0% | 100% | 0% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
source/src27% | 21% | 27% | 13% | 10%
additionalPackages/RevoIOQ24% | 8% | 29% | 11% | 25%
additionalPackages/doParallel31% | 21% | 27% | 11% | 8%
source/tools62% | 0% | 15% | 6% | 16%
source/doc0% | 0% | 50% | 39% | 10%
additionalPackages/RevoUtils0% | 0% | 75% | 15% | 8%
additionalPackages/RevoMods0% | 0% | 65% | 14% | 20%
source/share0% | 0% | 0% | 100% | 0%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
SEXP attribute_hidden do_dotCode()
in source/src/main/dotcode.c
1039 213 4
static SEXP bcEval()
in source/src/main/eval.c
883 125 3
get_exclude_patterns <- function()
in source/src/library/tools/R/build.R
815 143 0
do_install_source <- function()
in source/src/library/tools/R/install.R
663 205 4
SEXP attribute_hidden R_doDotCall()
in source/src/main/dotcode.c
660 67 4
escapeAmpersand <- function()
in source/src/library/tools/R/Rd2HTML.R
603 103 1
static void fftmx()
in source/src/library/stats/src/fft.c
515 76 14
Rd2latex <- function()
in source/src/library/tools/R/Rd2latex.R
512 66 8
httpd <- function()
in source/src/library/tools/R/dynamicHelp.R
507 88 3
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 C_axis()
in source/src/library/graphics/src/plot.c
416 107 1
SEXP attribute_hidden do_gsub()
in source/src/main/grep.c
391 136 4
loadNamespace <- function()
in source/src/library/base/R/namespace.R
389 70 3
static SEXP Query()
in source/src/library/graphics/src/par.c
376 85 2
static void Specify()
in source/src/library/graphics/src/par.c
351 60 3
psub <- function()
in source/src/library/tools/R/RdConv2.R
346 57 3
SEXP attribute_hidden do_summary()
in source/src/main/summary.c
346 130 4
SEXP attribute_hidden do_sprintf()
in source/src/main/sprintf.c
333 110 4