microsoft / lisa
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,986 units with 14,026 lines of code in units (50.9% of code).
    • 2 very long units (265 lines of code)
    • 16 long units (1,040 lines of code)
    • 123 medium size units (3,808 lines of code)
    • 207 small units (3,047 lines of code)
    • 1,638 very small units (5,866 lines of code)
1% | 7% | 27% | 21% | 41%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py1% | 7% | 27% | 22% | 40%
pyi0% | 0% | 0% | 0% | 100%
java0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
microsoft/testsuites7% | 17% | 35% | 15% | 23%
lisa0% | 5% | 27% | 26% | 40%
lisa/sut_orchestrator0% | 10% | 33% | 21% | 35%
lisa/runners0% | 11% | 37% | 25% | 25%
lisa/tools0% | 0% | 17% | 23% | 58%
lisa/transformers0% | 0% | 42% | 22% | 34%
lisa/util0% | 0% | 9% | 28% | 62%
lisa/features0% | 0% | 17% | 24% | 58%
lisa/notifiers0% | 0% | 26% | 26% | 46%
lisa/parameter_parser0% | 0% | 23% | 16% | 60%
lisa/combinators0% | 0% | 0% | 58% | 41%
typings/assertpy0% | 0% | 0% | 0% | 100%
typings/semver0% | 0% | 0% | 0% | 100%
lisa/base_tools0% | 0% | 0% | 0% | 100%
typings/pluggy0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def verify_repository_installed()
in microsoft/testsuites/core/azure_image_standard.py
158 38 2
def verify_sriov_ethtool_offload_setting()
in microsoft/testsuites/network/sriov.py
107 6 2
def _generate_min_capability()
in lisa/sut_orchestrator/azure/features.py
95 22 2
def _install()
in microsoft/testsuites/dpdk/dpdktestpmd.py
93 13 1
75 22 2
def validate_device_msg_level_change()
in microsoft/testsuites/network/networksettings.py
71 12 3
def _get_location_info()
in lisa/sut_orchestrator/azure/platform_.py
70 13 3
def check()
in lisa/schema.py
67 18 2
def verify_sriov_interrupts_change()
in microsoft/testsuites/network/sriov.py
66 10 2
def _install()
in microsoft/testsuites/dpdk/dpdknffgo.py
65 5 1
def validate_device_statistics()
in microsoft/testsuites/network/networksettings.py
61 18 3
def verify_vmbus_interrupts()
in microsoft/testsuites/core/cpu.py
56 15 3
def timesync_check_unbind_clocksource()
in microsoft/testsuites/core/timesync.py
56 9 2
def check()
in lisa/search_space.py
54 15 2
def nvme_function_validation()
in microsoft/testsuites/nvme/nvme.py
54 4 2
def discover_running_cases()
in lisa/runners/legacy_runner.py
53 17 1
def verify_os_partition_identifier()
in microsoft/testsuites/core/storage.py
53 10 3
def _install()
in microsoft/testsuites/xdp/xdptools.py
51 10 1
def __getitem__()
in lisa/executable.py
49 10 4
def timesync_check_unbind_clockevent()
in microsoft/testsuites/core/timesync.py
49 7 2