microsoft / msticpy
Conditional Complexity

The distribution of complexity of units (measured with McCabe index).

Intro
  • Conditional complexity (also called cyclomatic complexity) is a term used to measure the complexity of software. The term refers to the number of possible paths through a program function. A higher value ofter means higher maintenance and testing costs (infosecinstitute.com).
  • Conditional complexity is calculated by counting all conditions in the program that can affect the execution path (e.g. if statement, loops, switches, and/or operators, try and catch blocks...).
  • Conditional complexity is measured at the unit level (methods, functions...).
  • Units are classified in four categories based on the measured McCabe index: 1-5 (simple units), 6-10 (medium complex units), 11-25 (complex units), 26+ (very complex units).
Learn more...
Conditional Complexity Overall
  • There are 1,832 units with 15,970 lines of code in units (44.8% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 52 medium complex units (1,644 lines of code)
    • 169 simple units (3,580 lines of code)
    • 1,611 very simple units (10,746 lines of code)
0% | 0% | 10% | 22% | 67%
Legend:
51+
26-50
11-25
6-10
1-5
Alternative Visuals
Conditional Complexity per Extension
51+
26-50
11-25
6-10
1-5
py0% | 0% | 10% | 22% | 67%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
msticpy/nbtools0% | 0% | 11% | 26% | 61%
msticpy/datamodel0% | 0% | 15% | 21% | 62%
msticpy/data0% | 0% | 9% | 17% | 72%
msticpy/sectools0% | 0% | 10% | 21% | 68%
msticpy/common0% | 0% | 9% | 27% | 63%
msticpy/config0% | 0% | 4% | 25% | 70%
msticpy/analysis0% | 0% | 9% | 11% | 78%
tools0% | 0% | 10% | 7% | 82%
tools/toollib0% | 0% | 10% | 29% | 60%
msticpy/vis0% | 0% | 0% | 57% | 42%
tools/misc0% | 0% | 0% | 47% | 52%
ROOT0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _create_from_event()
in msticpy/datamodel/entities/account.py
48 21 3
def _get_ip_functions()
in msticpy/datamodel/pivot_ti_provider.py
31 21 2
def _parse_expression()
in msticpy/data/sql_to_kql.py
41 20 1
def _find_os_family()
in msticpy/nbtools/security_base.py
29 19 1
def create_query()
in msticpy/data/query_source.py
35 18 4
def _get_or_create_config()
in msticpy/nbtools/nbinit.py
27 18 0
def _print_single_module()
in tools/analyze_imports.py
21 18 3
def _check_std_lib()
in tools/toollib/import_analyzer.py
37 18 1
def _execute_query()
in msticpy/data/data_providers.py
41 17 3
def _resolve_entity_refs()
in msticpy/nbtools/security_alert.py
31 17 1
def connect()
in msticpy/data/drivers/kql_driver.py
44 16 3
def _generate_base_ents()
in msticpy/datamodel/entities/alert.py
22 16 1
def pivot_lookup()
in msticpy/datamodel/pivot_register.py
33 16 2
def add_ip_cluster()
in msticpy/nbtools/foliummap.py
62 16 3
def create_alert_graph()
in msticpy/nbtools/security_alert_graph.py
49 16 1
def _print_all_imports()
in tools/analyze_imports.py
16 16 2
def _validate_defn()
in msticpy/config/mp_config_control.py
22 15 4
def _get_connection_string()
in msticpy/data/drivers/kusto_driver.py
26 15 3
def _map_ip4_address()
in msticpy/data/data_obfus.py
34 14 1
def _create_from_ent()
in msticpy/datamodel/entities/alert.py
25 14 2