flutter / assets-for-api-docs
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 589 units with 11,122 lines of code in units (51.0% of code).
    • 14 very long units (1,798 lines of code)
    • 49 long units (3,367 lines of code)
    • 106 medium size units (3,377 lines of code)
    • 80 small units (1,199 lines of code)
    • 340 very small units (1,381 lines of code)
16% | 30% | 30% | 10% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart16% | 30% | 30% | 10% | 12%
cc0% | 0% | 52% | 23% | 24%
swift0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
packages/diagrams/lib12% | 35% | 30% | 9% | 12%
packages/snippets/lib23% | 13% | 36% | 13% | 12%
packages/sampler/lib20% | 34% | 27% | 10% | 7%
packages/diagram_generator/lib89% | 0% | 0% | 10% | 0%
packages/diagram_capture/lib0% | 23% | 19% | 22% | 34%
packages/diagram_capture/example0% | 0% | 54% | 25% | 20%
packages/diagram_generator/linux0% | 0% | 53% | 23% | 22%
packages/animation_metadata/lib0% | 0% | 0% | 100% | 0%
packages/diagram_generator/macos0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Widget build()
in packages/sampler/lib/main.dart
195 19 1
Widget build()
in packages/diagrams/lib/src/heroes.dart
179 1 1
void parseComment()
in packages/snippets/lib/snippet_parser.dart
177 29 1
Future main()
in packages/diagram_generator/lib/main.dart
161 9 1
void openInIde()
in packages/sampler/lib/utils.dart
118 24 4
Widget build()
in packages/diagrams/lib/src/text.dart
115 1 1
String generateCode()
in packages/snippets/lib/snippet_generator.dart
113 18 8
Widget build()
in packages/diagrams/lib/src/radio_list_tile.dart
112 4 1
void _organizeDirectives()
in packages/snippets/lib/import_sorter.dart
111 22 0
void paint()
in packages/diagrams/lib/src/text.dart
109 1 2
Widget build()
in packages/diagrams/lib/src/text.dart
103 6 1
Widget build()
in packages/diagrams/lib/src/toggle_buttons.dart
103 13 1
Widget build()
in packages/diagrams/lib/src/grid_view.dart
101 3 1
Widget build()
in packages/diagrams/lib/src/theme_data.dart
101 3 1
Widget build()
in packages/diagrams/lib/src/media_query.dart
100 1 1
void paint()
in packages/diagrams/lib/src/curve.dart
96 7 2
Widget build()
in packages/diagrams/lib/src/tweens.dart
95 1 1
Widget build()
in packages/sampler/lib/new_sample.dart
90 7 1
void paint()
in packages/diagrams/lib/src/text.dart
89 2 2
Widget build()
in packages/diagrams/lib/src/blend_mode.dart
86 1 1