microsoft / knack
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 282 units with 2,743 lines of code in units (84.4% of code).
    • 1 very long units (101 lines of code)
    • 4 long units (256 lines of code)
    • 23 medium size units (655 lines of code)
    • 57 small units (809 lines of code)
    • 197 very small units (922 lines of code)
3% | 9% | 23% | 29% | 33%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py3% | 9% | 23% | 29% | 33%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
knack4% | 10% | 26% | 28% | 30%
knack/testsdk0% | 0% | 7% | 37% | 54%
scripts0% | 0% | 0% | 86% | 13%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _print_arguments()
in knack/help.py
101 25 2
def execute()
in knack/invocation.py
83 25 2
def _print_groups()
in knack/help.py
60 19 2
def __init__()
in knack/help.py
58 20 3
def load_command_table()
in knack/parser.py
55 4 2
def invoke()
in knack/cli.py
50 13 4
def _handle_deprecations()
in knack/arguments.py
40 14 3
def __init__()
in knack/cli.py
40 3 14
def _handle_previews()
in knack/arguments.py
37 6 3
def _handle_experimentals()
in knack/arguments.py
37 6 3
def extract_args_from_signature()
in knack/introspection.py
35 12 2
def __init__()
in knack/config.py
34 11 5
31 5 2
def _print_header()
in knack/help.py
27 9 3
def option_descriptions()
in knack/introspection.py
27 4 1
def __init__()
in knack/commands.py
26 6 5
def __init__()
in knack/testsdk/base.py
26 6 4
def _get_subparser()
in knack/parser.py
24 13 3
def positional()
in knack/arguments.py
23 9 4
def __init__()
in knack/deprecation.py
23 5 10