dart-lang / dartdoc
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 1,022 units with 21,792 lines of code in units (43.5% of code).
    • 0 very complex units (0 lines of code)
    • 10 complex units (1,903 lines of code)
    • 50 medium complex units (5,083 lines of code)
    • 79 simple units (3,026 lines of code)
    • 883 very simple units (11,780 lines of code)
0% | 8% | 23% | 13% | 54%
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
dart0% | 8% | 23% | 14% | 54%
js0% | 41% | 12% | 0% | 46%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib/src/generator0% | 8% | 26% | 10% | 54%
lib/src/model0% | 18% | 13% | 23% | 43%
tool/mustachio0% | 19% | 4% | 16% | 58%
lib/resources0% | 41% | 12% | 0% | 46%
lib/src0% | 0% | 22% | 26% | 50%
lib/src/mustachio0% | 0% | 43% | 31% | 24%
lib/src/render0% | 0% | 14% | 4% | 81%
tool0% | 0% | 5% | 15% | 79%
lib/src/comment_references0% | 0% | 18% | 48% | 32%
lib0% | 0% | 0% | 81% | 18%
testing/sky_engine/sdk0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void _generateDocs()
in lib/src/generator/generator_frontend.dart
187 50 3
void _warnOnElement()
in lib/src/model/package_graph.dart
145 42 5
String renderSidebarForContainer()
in lib/src/generator/templates.aot_renderers_for_html.dart
230 35 1
String renderClass()
in lib/src/generator/templates.aot_renderers_for_html.dart
343 33 1
ModelElement? findCanonicalModelElementFor()
in lib/src/model/package_graph.dart
107 31 2
String renderClass()
in lib/src/generator/templates.aot_renderers_for_md.dart
229 30 1
void _writePropertyMap()
in tool/mustachio/codegen_runtime_renderer.dart
155 29 1
function initializeSearch()
in lib/resources/script.js
138 27 2
String renderMixin()
in lib/src/generator/templates.aot_renderers_for_html.dart
283 27 1
static ModelElement? _fromParameters()
in lib/src/model/model_element.dart
86 27 5
String renderMixin()
in lib/src/generator/templates.aot_renderers_for_md.dart
187 24 1
_KeyParseResult _parseKey()
in lib/src/mustachio/parser.dart
54 24 1
String renderEnum()
in lib/src/generator/templates.aot_renderers_for_html.dart
225 21 1
function findMatches()
in lib/resources/script.js
42 19 2
String renderCategory()
in lib/src/generator/templates.aot_renderers_for_md.dart
144 19 1
String renderLibrary()
in lib/src/generator/templates.aot_renderers_for_md.dart
170 19 1
String renderCategory()
in lib/src/generator/templates.aot_renderers_for_html.dart
213 19 1
String _renderCategory_partial_sidebar_for_category_10()
in lib/src/generator/templates.aot_renderers_for_html.dart
171 19 1
String renderLibrary()
in lib/src/generator/templates.aot_renderers_for_html.dart
238 19 1
String renderSidebarForLibrary()
in lib/src/generator/templates.aot_renderers_for_html.dart
154 19 1