dart-lang / wasm
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 86 units with 803 lines of code in units (28.1% of code).
    • 0 very long units (0 lines of code)
    • 1 long units (77 lines of code)
    • 3 medium size units (71 lines of code)
    • 24 small units (356 lines of code)
    • 58 very small units (299 lines of code)
0% | 9% | 8% | 44% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
dart0% | 11% | 7% | 50% | 30%
py0% | 0% | 18% | 12% | 69%
kt0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
wasm/example0% | 100% | 0% | 0% | 0%
wasm/lib/src0% | 0% | 8% | 57% | 34%
wasm/tool0% | 0% | 18% | 12% | 69%
flutter_wasm/example/lib0% | 0% | 0% | 63% | 36%
flutter_wasm/android/src0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void main()
in wasm/example/brotli.dart
77 4 1
Pointer loadModule()
in wasm/lib/src/runtime.g.dart
25 3 3
def parseType()
in wasm/tool/generate_ffi_boilerplate.py
24 8 1
bool fill()
in wasm/lib/src/wasmer_api.dart
22 9 2
void addFunction()
in wasm/lib/src/module.dart
20 2 3
List importDescriptors()
in wasm/lib/src/runtime.g.dart
20 2 1
Pointer newMemory()
in wasm/lib/src/runtime.g.dart
20 1 3
String _getImportExportString()
in wasm/lib/src/runtime.dart
19 3 3
List exportDescriptors()
in wasm/lib/src/runtime.g.dart
19 2 1
static void _call()
in wasm/lib/src/module.dart
18 4 3
Pointer newFunc()
in wasm/lib/src/runtime.g.dart
18 1 5
dynamic apply()
in wasm/lib/src/module.dart
17 5 1
void maybeThrowTrap()
in wasm/lib/src/runtime.g.dart
16 3 2
String wasmerValKindName()
in wasm/lib/src/wasmer_api.dart
16 6 1
def getWasmerApi()
in wasm/tool/generate_ffi_boilerplate.py
16 6 0
Pointer instantiate()
in wasm/lib/src/runtime.g.dart
14 1 3
String wasmerExternKindName()
in wasm/lib/src/wasmer_api.dart
14 5 1
void enableWasi()
in wasm/lib/src/module.dart
13 4 3
String describe()
in wasm/lib/src/module.dart
12 3 0
Pointer _wasmFnImportTrampoline()
in wasm/lib/src/module.dart
12 2 3