dart-lang / pub-dev
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,273 units with 19,796 lines of code in units (52.4% of code).
    • 1 very complex units (188 lines of code)
    • 4 complex units (494 lines of code)
    • 43 medium complex units (2,546 lines of code)
    • 132 simple units (4,036 lines of code)
    • 1,093 very simple units (12,532 lines of code)
<1% | 2% | 12% | 20% | 63%
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
dart<1% | 2% | 12% | 20% | 63%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
app/lib1% | 3% | 12% | 20% | 62%
pkg/pub_package_reader0% | 0% | 32% | 42% | 24%
pkg/pub_integration0% | 0% | 8% | 0% | 91%
pkg/fake_gcloud0% | 0% | 23% | 6% | 70%
pkg/pub_validations0% | 0% | 67% | 27% | 4%
pkg/web_app0% | 0% | 5% | 21% | 73%
pkg/code_coverage0% | 0% | 37% | 41% | 21%
pkg/pub_dartdoc0% | 0% | 35% | 14% | 49%
tool0% | 0% | 22% | 40% | 37%
pkg/api_builder0% | 0% | 0% | 25% | 74%
pkg/indexed_blob0% | 0% | 0% | 19% | 80%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
Stream _checkPackage()
in app/lib/shared/integrity.dart
188 65 1
Future search()
in app/lib/search/mem_index.dart
121 31 1
_TextResults? _searchText()
in app/lib/search/mem_index.dart
104 30 4
Future analyze()
in app/lib/fake/backend/fake_pana_runner.dart
74 26 4
Future process()
in app/lib/dartdoc/dartdoc_runner.dart
195 26 1
void validateHtml()
in pkg/pub_validations/lib/html/html_validation.dart
83 23 1
Future summarizePackageArchive()
in pkg/pub_package_reader/lib/pub_package_reader.dart
162 22 5
Future documentationHandler()
in app/lib/frontend/handlers/documentation.dart
84 22 1
Stream list()
in pkg/fake_gcloud/lib/mem_storage.dart
38 20 2
Future updateReportOnCard()
in app/lib/scorecard/backend.dart
120 19 5
ServiceSearchQuery toServiceQuery()
in app/lib/search/search_form.dart
41 18 0
String? getRepositoryUrl()
in app/lib/shared/urls.dart
46 18 4
Future _performTarballUpload()
in app/lib/package/backend.dart
121 18 3
Future _tryAuthenticateJwt()
in app/lib/account/google_oauth2.dart
65 17 1
void updateDartdocStatus()
in pkg/web_app/lib/src/dartdoc_status.dart
73 16 0
Iterable validateZalgo()
in pkg/pub_package_reader/lib/pub_package_reader.dart
18 16 2
Future withPage()
in pkg/pub_integration/lib/src/headless_env.dart
76 16 2
Future getScoreCardData()
in app/lib/scorecard/backend.dart
51 16 4
Map _parsePubspecLockSync()
in tool/pub_get_offline.dart
31 16 1
Future startIsolates()
in app/lib/service/entrypoint/_isolate.dart
172 15 2