flutter / gallery
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 803 units with 63,074 lines of code in units (92.3% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (421 lines of code)
    • 4 medium complex units (301 lines of code)
    • 30 simple units (1,486 lines of code)
    • 767 very simple units (60,866 lines of code)
0% | <1% | <1% | 2% | 96%
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% | <1% | <1% | 2% | 96%
cpp0% | 0% | 0% | 0% | 100%
cc0% | 0% | 0% | 0% | 100%
swift0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib/pages0% | 9% | 0% | 14% | 76%
tool/codeviewer_cli0% | 32% | 23% | 15% | 28%
lib/studies0% | 0% | 2% | 8% | 89%
lib/feature_discovery0% | 0% | 0% | 16% | 83%
tool/l10n_cli0% | 0% | 0% | 75% | 24%
lib/layout0% | 0% | 0% | 39% | 60%
lib/codeviewer0% | 0% | 0% | 0% | 100%
lib/data0% | 0% | 0% | 0% | 100%
windows/runner0% | 0% | 0% | 0% | 100%
lib0% | 0% | 0% | 0% | 100%
linux0% | 0% | 0% | 0% | 100%
lib/themes0% | 0% | 0% | 0% | 100%
tool0% | 0% | 0% | 0% | 100%
macos/Flutter0% | 0% | 0% | 0% | 100%
linux/flutter0% | 0% | 0% | 0% | 100%
windows/flutter0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
Widget build()
in lib/pages/demo.dart
279 26 1
bool _generateSpans()
in tool/codeviewer_cli/prehighlighter.dart
142 26 0
Map _createSegments()
in tool/codeviewer_cli/segment_generator.dart
103 21 1
void _iterateUntilBalanced()
in lib/studies/shrine/supplemental/balanced_layout.dart
60 16 2
Widget build()
in lib/studies/reply/mailbox_body.dart
111 15 1
void _updateLists()
in lib/studies/shrine/expanding_bottom_sheet.dart
27 11 0
_FileReadStatus _updatedStatus()
in tool/codeviewer_cli/segment_generator.dart
28 10 2
Future generateXmlFromArb()
in tool/l10n_cli/l10n_cli.dart
66 10 1
Widget build()
in lib/studies/reply/mail_card_preview.dart
79 9 1
Widget build()
in lib/studies/crane/header_form.dart
43 9 1
void initAnimationControllers()
in lib/feature_discovery/feature_discovery.dart
60 9 0
String _styleNameOf()
in tool/codeviewer_cli/prehighlighter.dart
21 9 1
String _escape()
in tool/codeviewer_cli/prehighlighter.dart
20 9 1
List _buildColumns()
in lib/studies/shrine/supplemental/asymmetric_view.dart
62 8 2
Widget build()
in lib/studies/crane/backdrop.dart
52 8 1
Animation tapTargetRadius()
in lib/feature_discovery/animation.dart
43 8 1
void _resolveState()
in lib/pages/demo.dart
16 8 1
void _handleDragEnd()
in lib/studies/reply/adaptive_nav.dart
26 7 1
Widget build()
in lib/studies/reply/adaptive_nav.dart
92 7 1
Widget _buildCart()
in lib/studies/shrine/expanding_bottom_sheet.dart
65 7 1