dart-lang / graphs
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 17 units with 287 lines of code in units (59.7% of code).
    • 0 very long units (0 lines of code)
    • 0 long units (0 lines of code)
    • 6 medium size units (204 lines of code)
    • 1 small units (14 lines of code)
    • 10 very small units (69 lines of code)
0% | 0% | 71% | 4% | 24%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 0% | 71% | 4% | 24%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
benchmark0% | 0% | 100% | 0% | 0%
lib/src0% | 0% | 70% | 0% | 29%
example0% | 0% | 0% | 31% | 68%
Alternative Visuals
Longest Units
Top 17 longest units
Unit# linesMcCabe index# params
Iterable Function()
in lib/src/strongly_connected_components.dart
41 8 1
void main()
in benchmark/shortest_path_benchmark.dart
38 8 0
void main()
in benchmark/shortest_path_worst_case_benchmark.dart
38 10 0
void main()
in benchmark/connected_components_benchmark.dart
34 8 0
Iterable Function()
in lib/src/shortest_path.dart
30 7 1
List topologicalSort()
in lib/src/topological_sort.dart
23 5 2
void main()
in example/example.dart
14 1 0
Future run()
in lib/src/crawl_async.dart
9 2 0
Future main()
in example/crawl_async_example.dart
9 1 0
Uri resolveImport()
in example/crawl_async_example.dart
8 2 2
Stream crawlAsync()
in lib/src/crawl_async.dart
7 1 2
Future _crawlFrom()
in lib/src/crawl_async.dart
7 2 1
Iterable? shortestPath()
in lib/src/shortest_path.dart
7 1 3
Future pathForUri()
in example/crawl_async_example.dart
7 3 1
Future parseUri()
in example/crawl_async_example.dart
6 1 1
Future _visit()
in lib/src/crawl_async.dart
5 2 1
Iterable Function()
in lib/src/shortest_path.dart
4 1 1