dart-lang / pana
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 172 units with 3,817 lines of code in units (62.4% of code).
    • 0 very complex units (0 lines of code)
    • 2 complex units (476 lines of code)
    • 12 medium complex units (679 lines of code)
    • 31 simple units (1,006 lines of code)
    • 127 very simple units (1,656 lines of code)
0% | 12% | 17% | 26% | 43%
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% | 12% | 17% | 26% | 43%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
lib/src/report0% | 50% | 10% | 6% | 31%
lib/src0% | 0% | 17% | 35% | 47%
lib/src/license_detection0% | 0% | 27% | 24% | 48%
lib/src/tag0% | 0% | 24% | 47% | 28%
lib/src/batch0% | 0% | 0% | 14% | 85%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
Future followsTemplate()
in lib/src/report/template.dart
275 34 1
Future trustworthyDependency()
in lib/src/report/dependencies.dart
201 30 1
List _buildDeps()
in lib/src/pkg_resolution.dart
80 19 3
List fuseMatchedRanges()
in lib/src/license_detection/token_matcher.dart
74 19 5
Future _inspect()
in lib/src/package_analyzer.dart
102 18 2
void nullSafetyTags()
in lib/src/tag/tagger.dart
77 15 2
Future multiPlatform()
in lib/src/report/multi_platform.dart
99 13 2
int severityCompareTo()
in lib/src/internal_model.dart
9 13 1
List detectRuns()
in lib/src/license_detection/token_matcher.dart
52 13 5
Set? _declaredPlatforms()
in lib/src/tag/_violations.dart
37 12 1
List removeOverLappingMatches()
in lib/src/license_detection/license_detector.dart
40 12 1
void verifyNoGplChange()
in lib/src/license_detection/confidence.dart
32 12 2
Future resolveDependencies()
in lib/src/package_context.dart
36 11 0
RepositoryUrl? _tryParseRepositoryUrl()
in lib/src/repository_url.dart
41 11 1
Future staticAnalysis()
in lib/src/report/static_analysis.dart
45 10 1
33 10 1
static Iterable parse()
in lib/src/pkg_resolution.dart
33 9 1
void verifyNoVersionChange()
in lib/src/license_detection/confidence.dart
22 9 2
List _cleanTokens()
in lib/src/license_detection/tokenizer.dart
34 9 1
Future runAnalyzer()
in lib/src/sdk_env.dart
59 8 5