microsoft / msticpy
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,832 units with 15,970 lines of code in units (44.8% of code).
    • 0 very long units (0 lines of code)
    • 12 long units (753 lines of code)
    • 161 medium size units (4,748 lines of code)
    • 304 small units (4,437 lines of code)
    • 1,355 very small units (6,032 lines of code)
0% | 4% | 29% | 27% | 37%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
py0% | 4% | 29% | 27% | 37%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
msticpy/nbtools0% | 6% | 28% | 27% | 37%
msticpy/analysis0% | 24% | 20% | 14% | 41%
tools0% | 23% | 34% | 27% | 15%
msticpy/sectools0% | 4% | 30% | 22% | 42%
msticpy/vis0% | 20% | 33% | 16% | 28%
msticpy/config0% | 3% | 26% | 32% | 37%
msticpy/data0% | 0% | 34% | 31% | 34%
msticpy/datamodel0% | 0% | 30% | 28% | 41%
msticpy/common0% | 0% | 28% | 29% | 42%
tools/toollib0% | 0% | 17% | 47% | 34%
tools/misc0% | 0% | 47% | 25% | 27%
ROOT0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
def _add_script_args()
in tools/config2kv.py
85 1 1
def plot_matrix()
in msticpy/vis/matrix_plot.py
70 10 2
def cluster_auditd_processes()
in msticpy/analysis/cluster_auditd.py
68 4 2
def _display_timeline_dict()
in msticpy/nbtools/timeline.py
66 8 2
def parse_results()
in msticpy/sectools/tiproviders/ibm_xforce.py
65 14 2
def __init__()
in msticpy/nbtools/data_viewer.py
63 1 2
def add_ip_cluster()
in msticpy/nbtools/foliummap.py
62 16 3
def _add_script_args()
in tools/analyze_imports.py
60 1 0
def _laplace_smooth_counts()
in msticpy/analysis/anomalous_sequence/model.py
57 5 1
def __init__()
in msticpy/config/file_browser.py
55 1 4
def _compute_counts()
in msticpy/analysis/anomalous_sequence/model.py
51 6 1
def cluster_syslog_logons_df()
in msticpy/sectools/syslog_utils.py
51 13 1
def compute_setof_params_cond_cmd()
in msticpy/analysis/anomalous_sequence/model.py
49 11 2
def create_alert_graph()
in msticpy/nbtools/security_alert_graph.py
49 16 1
def _add_script_args()
in tools/create_reqs_all.py
49 1 0
def _create_from_event()
in msticpy/datamodel/entities/account.py
48 21 3
def _add_script_args()
in tools/mp_test_extras.py
48 1 0
def _init_filter_ctrls()
in msticpy/data/browsers/mordor_browser.py
47 1 1
def run_txt2df()
in msticpy/datamodel/pivot_magic_core.py
47 11 3
def screenshot()
in msticpy/sectools/domain_utils.py
47 11 2