dart-lang / http2
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 183 units with 2,282 lines of code in units (62.0% of code).
    • 1 very long units (106 lines of code)
    • 5 long units (350 lines of code)
    • 19 medium size units (593 lines of code)
    • 41 small units (618 lines of code)
    • 117 very small units (615 lines of code)
4% | 15% | 25% | 27% | 26%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart4% | 15% | 25% | 27% | 26%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src/frames19% | 23% | 3% | 30% | 22%
lib/src/hpack0% | 33% | 45% | 13% | 7%
lib/src/streams0% | 16% | 25% | 31% | 27%
lib/src0% | 14% | 28% | 19% | 37%
lib/src/flowcontrol0% | 0% | 34% | 37% | 28%
lib/src/settings0% | 0% | 54% | 27% | 18%
example0% | 0% | 69% | 30% | 0%
lib0% | 0% | 38% | 0% | 61%
lib/src/ping0% | 0% | 0% | 54% | 45%
lib/src/async_utils0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
Frame _readFrame()
in lib/src/frames/frame_reader.dart
106 17 3
List decode()
in lib/src/hpack/hpack.dart
85 15 1
Stream startDecoding()
in lib/src/frames/frame_reader.dart
78 10 0
void _processStreamFrameInternal()
in lib/src/streams/stream_handler.dart
77 21 2
void _setupConnection()
in lib/src/connection.dart
56 2 3
Frame? tryDefragmentFrame()
in lib/src/frames/frame_defragmenter.dart
54 13 1
List decode()
in lib/src/hpack/huffman.dart
42 10 1
void _changeState()
in lib/src/streams/stream_handler.dart
42 39 2
void _trySendData()
in lib/src/flowcontrol/stream_queues.dart
41 10 0
void _modifySettings()
in lib/src/settings/settings.dart
40 11 3
List encode()
in lib/src/hpack/hpack.dart
38 5 1
void _handleFrameImpl()
in lib/src/connection.dart
38 12 1
void _trySendMessage()
in lib/src/flowcontrol/connection_queues.dart
38 7 0
List encode()
in lib/src/hpack/huffman.dart
35 7 1
void _tryDispatch()
in lib/src/flowcontrol/stream_queues.dart
34 13 0
Http2StreamImpl _newStreamInternal()
in lib/src/streams/stream_handler.dart
33 3 1
void main()
in example/display_headers.dart
32 7 1
ServerTransportStream _push()
in lib/src/streams/stream_handler.dart
26 6 2
Future _terminate()
in lib/src/connection.dart
24 4 3
void onData()
in lib/src/connection_preface.dart
23 9 1