awslabs / amazon-redshift-utils
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 469 units with 6,957 lines of code in units (60.0% of code).
    • 1 very complex units (124 lines of code)
    • 8 complex units (1,004 lines of code)
    • 35 medium complex units (1,779 lines of code)
    • 56 simple units (1,478 lines of code)
    • 369 very simple units (2,572 lines of code)
1% | 14% | 25% | 21% | 36%
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
py1% | 14% | 26% | 20% | 35%
js0% | 0% | 0% | 35% | 64%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/ColumnEncodingUtility16% | 41% | 17% | 10% | 13%
src/SimpleReplay0% | 11% | 38% | 21% | 28%
src/AnalyzeVacuumUtility0% | 33% | 53% | 4% | 8%
src/RedshiftAutomation0% | 45% | 17% | 34% | 2%
src/SystemTablePersistence0% | 47% | 0% | 37% | 15%
src/MetadataTransfer0% | 18% | 28% | 44% | 8%
src/UnloadCopyUtility0% | 0% | 6% | 17% | 75%
src/MultipleTableRestoreUtility0% | 0% | 65% | 0% | 34%
src/UnloadAutoPartitions0% | 0% | 41% | 49% | 8%
src/SnapshotManager0% | 0% | 0% | 31% | 68%
src/UserLastLogin0% | 0% | 0% | 80% | 19%
src0% | 0% | 0% | 31% | 68%
src/WorkloadManagementScheduler0% | 0% | 0% | 33% | 66%
src/QMRNotificationUtility0% | 0% | 0% | 0% | 100%
src/BlogContent0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def main()
in src/ColumnEncodingUtility/analyze-schema-compression.py
124 75 1
def analyze()
in src/ColumnEncodingUtility/analyze-schema-compression.py
236 48 1
def event_handler()
in src/RedshiftAutomation/lambda_function.py
90 36 2
def main()
in src/SimpleReplay/replay.py
174 34 0
def validate_config()
in src/SimpleReplay/replay.py
105 32 1
def reduce_column_length()
in src/ColumnEncodingUtility/analyze-schema-compression.py
64 30 3
def run_vacuum()
in src/AnalyzeVacuumUtility/lib/analyze_vacuum.py
195 29 12
def snapshot()
in src/SystemTablePersistence/snapshot_system_stats.py
80 28 1
def deriveddls()
in src/MetadataTransfer/userprivs.py
60 26 2
def start_replay()
in src/SimpleReplay/replay.py
72 25 10
def Print_Human_Readable()
in src/SimpleReplay/PreviousVersion/ParseUserActivityLog.py
40 25 4
def save_logs()
in src/SimpleReplay/extract.py
119 25 6
def validate_config_file()
in src/SimpleReplay/extract.py
101 25 1
def replay_worker()
in src/SimpleReplay/replay.py
71 20 10
def run_analyze()
in src/AnalyzeVacuumUtility/lib/analyze_vacuum.py
199 19 10
def handler()
in src/SimpleReplay/cloudformation/LambdaReplay.py
67 17 2
def execute_transaction()
in src/SimpleReplay/replay.py
36 15 3
def parse_transaction()
in src/SimpleReplay/replay.py
42 15 2
def get_connection_string()
in src/SimpleReplay/replay.py
84 15 4
def main()
in src/SimpleReplay/extract.py
95 15 0