dart-lang / dartdoc
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 1,022 units with 21,792 lines of code in units (43.5% of code).
    • 35 very long units (5,834 lines of code)
    • 46 long units (2,802 lines of code)
    • 168 medium size units (5,522 lines of code)
    • 349 small units (4,982 lines of code)
    • 424 very small units (2,652 lines of code)
26% | 12% | 25% | 22% | 12%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart26% | 13% | 25% | 22% | 12%
js41% | 0% | 20% | 22% | 16%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src/generator35% | 13% | 19% | 21% | 9%
lib/src/model13% | 12% | 32% | 26% | 14%
tool/mustachio19% | 6% | 51% | 15% | 6%
lib/resources41% | 0% | 20% | 22% | 16%
lib/src5% | 6% | 45% | 16% | 25%
tool0% | 23% | 17% | 41% | 17%
lib/src/mustachio0% | 26% | 42% | 16% | 15%
lib/src/render0% | 9% | 28% | 46% | 14%
lib/src/comment_references0% | 0% | 46% | 39% | 13%
lib0% | 0% | 81% | 0% | 18%
testing/sky_engine/sdk0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
String renderClass()
in lib/src/generator/templates.aot_renderers_for_html.dart
343 33 1
String renderMixin()
in lib/src/generator/templates.aot_renderers_for_html.dart
283 27 1
String renderLibrary()
in lib/src/generator/templates.aot_renderers_for_html.dart
238 19 1
String renderSidebarForContainer()
in lib/src/generator/templates.aot_renderers_for_html.dart
230 35 1
String renderClass()
in lib/src/generator/templates.aot_renderers_for_md.dart
229 30 1
String renderEnum()
in lib/src/generator/templates.aot_renderers_for_html.dart
225 21 1
String renderCategory()
in lib/src/generator/templates.aot_renderers_for_html.dart
213 19 1
String renderMixin()
in lib/src/generator/templates.aot_renderers_for_md.dart
187 24 1
void _generateDocs()
in lib/src/generator/generator_frontend.dart
187 50 3
String renderExtension()
in lib/src/generator/templates.aot_renderers_for_html.dart
181 13 1
String _renderCategory_partial_sidebar_for_category_10()
in lib/src/generator/templates.aot_renderers_for_html.dart
171 19 1
String renderLibrary()
in lib/src/generator/templates.aot_renderers_for_md.dart
170 19 1
void _writePropertyMap()
in tool/mustachio/codegen_runtime_renderer.dart
155 29 1
String renderSidebarForLibrary()
in lib/src/generator/templates.aot_renderers_for_html.dart
154 19 1
void _warnOnElement()
in lib/src/model/package_graph.dart
145 42 5
String renderCategory()
in lib/src/generator/templates.aot_renderers_for_md.dart
144 19 1
String renderEnum()
in lib/src/generator/templates.aot_renderers_for_md.dart
143 18 1
String _renderExtension_partial_head_0()
in lib/src/generator/templates.aot_renderers_for_html.dart
141 12 1
String _renderTopLevelProperty_partial_head_0()
in lib/src/generator/templates.aot_renderers_for_html.dart
141 12 1
String _renderCategory_partial_head_0()
in lib/src/generator/templates.aot_renderers_for_html.dart
140 12 1