dart-lang / watcher
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 81 units with 888 lines of code in units (59.8% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (51 lines of code)
    • 11 medium size units (327 lines of code)
    • 17 small units (227 lines of code)
    • 52 very small units (283 lines of code)
0% | 5% | 36% | 25% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 5% | 36% | 25% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib/src/directory_watcher0% | 9% | 48% | 23% | 18%
lib/src0% | 0% | 16% | 29% | 54%
lib/src/file_watcher0% | 0% | 45% | 18% | 35%
benchmark0% | 0% | 0% | 41% | 58%
example0% | 0% | 0% | 0% | 100%
lib0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void _onBatch()
in lib/src/directory_watcher/mac_os.dart
51 13 1
void _onBatch()
in lib/src/directory_watcher/windows.dart
43 12 1
FileSystemEvent? _canonicalEvent()
in lib/src/directory_watcher/mac_os.dart
37 16 1
void _onBatch()
in lib/src/directory_watcher/linux.dart
33 8 1
FileSystemEvent? _canonicalEvent()
in lib/src/directory_watcher/windows.dart
33 15 1
List _eventsBasedOnFileSystem()
in lib/src/directory_watcher/windows.dart
33 9 1
Set remove()
in lib/src/path_set.dart
28 9 1
List _eventsBasedOnFileSystem()
in lib/src/directory_watcher/mac_os.dart
27 9 1
Future _poll()
in lib/src/file_watcher/polling.dart
27 9 0
void _poll()
in lib/src/directory_watcher/polling.dart
23 4 0
void _applyChanges()
in lib/src/directory_watcher/linux.dart
22 9 3
void _startParentWatcher()
in lib/src/directory_watcher/windows.dart
21 7 0
Future _processFile()
in lib/src/directory_watcher/polling.dart
19 8 1
void close()
in lib/src/directory_watcher/windows.dart
17 3 0
void _startWatch()
in lib/src/directory_watcher/windows.dart
16 3 0
void setup()
in benchmark/path_set.dart
16 2 0
DirectoryWatcher? createCustomDirectoryWatcher()
in lib/src/custom_watcher_factory.dart
15 3 2
FileWatcher? createCustomFileWatcher()
in lib/src/custom_watcher_factory.dart
14 3 2
void walkTree()
in benchmark/path_set.dart
14 3 2
void _addSubdir()
in lib/src/directory_watcher/linux.dart
13 3 1