dart-lang / markdown
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 114 units with 2,062 lines of code in units (39.6% of code).
    • 1 very long units (104 lines of code)
    • 7 long units (408 lines of code)
    • 27 medium size units (841 lines of code)
    • 27 small units (405 lines of code)
    • 52 very small units (304 lines of code)
5% | 19% | 40% | 19% | 14%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart5% | 19% | 40% | 19% | 14%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src7% | 20% | 31% | 21% | 18%
tool0% | 21% | 63% | 11% | 3%
example0% | 0% | 55% | 43% | 1%
benchmark0% | 0% | 58% | 0% | 41%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Node parse()
in lib/src/block_parser.dart
104 30 1
void _processEmphasis()
in lib/src/inline_parser.dart
68 21 1
66 21 1
String escapeAttribute()
in lib/src/util.dart
61 37 1
static DelimiterRun? tryParse()
in lib/src/inline_parser.dart
56 13 6
Future main()
in tool/stats.dart
55 10 1
Element _parseRow()
in lib/src/block_parser.dart
51 12 3
Future _processConfig()
in tool/stats.dart
51 14 6
bool onMatch()
in lib/src/inline_parser.dart
50 14 2
void _linkOrImage()
in lib/src/inline_parser.dart
46 9 0
InlineLink? _parseInlineBracketedLink()
in lib/src/inline_parser.dart
45 18 1
List? _extractReflinkDefinitions()
in lib/src/block_parser.dart
45 10 2
void main()
in tool/dartdoc_compare.dart
44 7 1
bool _compareHtml()
in tool/stats_lib.dart
39 10 2
String? _parseTitle()
in lib/src/inline_parser.dart
37 15 1
Iterable dataCasesInFile()
in tool/expected_output.dart
37 7 2
Node? close()
in lib/src/inline_parser.dart
35 8 4
Node? parse()
in lib/src/block_parser.dart
33 9 1
CompareResult compareResult()
in tool/stats_lib.dart
33 10 5
Future _printFriendly()
in tool/stats.dart
33 2 3