dart-lang / webcore
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 822 units with 7,783 lines of code in units (82.4% of code).
    • 4 very long units (663 lines of code)
    • 13 long units (911 lines of code)
    • 62 medium size units (1,821 lines of code)
    • 130 small units (1,908 lines of code)
    • 613 very small units (2,480 lines of code)
8% | 11% | 23% | 24% | 31%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py8% | 11% | 23% | 24% | 31%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
bindings/scripts11% | 13% | 24% | 23% | 26%
blink/tools0% | 21% | 39% | 13% | 26%
modules/bluetooth/testing/clusterfuzz0% | 0% | 27% | 34% | 38%
core/frame0% | 0% | 80% | 0% | 20%
bindings0% | 0% | 87% | 0% | 12%
idl_parser0% | 0% | 2% | 29% | 67%
blink/tools/blinkpy/common0% | 0% | 0% | 51% | 48%
core/inspector0% | 0% | 0% | 72% | 27%
modules/webgl0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def interface_context()
in bindings/scripts/v8_interface.py
241 38 2
def methods_context()
in bindings/scripts/v8_interface.py
181 23 1
def attribute_context()
in bindings/scripts/v8_attributes.py
127 33 3
def method_context()
in bindings/scripts/v8_methods.py
114 30 3
def update()
in blink/tools/move_blink_source.py
91 6 1
def cpp_type()
in bindings/scripts/v8_types.py
83 50 6
def __init__()
in bindings/scripts/idl_definitions.py
82 26 2
def container_context()
in bindings/scripts/v8_union.py
80 25 2
def collect_info()
in bindings/scripts/compute_interfaces_info_individual.py
78 14 3
def overloads_context()
in bindings/scripts/v8_interface.py
77 35 2
def resolution_tests_methods()
in bindings/scripts/v8_interface.py
70 56 1
def compute_interfaces_info_overall()
in bindings/scripts/compute_interfaces_info_overall.py
68 21 1
def create_interface_context()
in bindings/scripts/generate_v8_context_snapshot_external_references.py
65 21 3
def v8_value_to_cpp_value()
in bindings/scripts/v8_types.py
61 29 5
def ext_attributes_node_to_extended_attributes()
in bindings/scripts/idl_definitions.py
53 28 1
def argument_context()
in bindings/scripts/v8_methods.py
52 9 5
def member_impl_context()
in bindings/scripts/v8_dictionary.py
51 16 4
def member_context()
in bindings/scripts/v8_dictionary.py
50 7 2
def generate_interface_code()
in bindings/scripts/code_generator_v8.py
47 10 4
def write_event_interfaces_file()
in bindings/scripts/generate_event_interfaces.py
45 8 3