pytorch / test-infra
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 237 units with 4,009 lines of code in units (56.0% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 6 medium complex units (263 lines of code)
    • 25 simple units (846 lines of code)
    • 206 very simple units (2,900 lines of code)
0% | 0% | 6% | 21% | 72%
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% | 16% | 21% | 62%
ts0% | 0% | 3% | 21% | 74%
tsx0% | 0% | 0% | 20% | 79%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
aws/lambda0% | 0% | 10% | 21% | 67%
torchci/lib0% | 0% | 4% | 27% | 68%
torchci/log_classifier0% | 0% | 19% | 29% | 51%
tools/scripts0% | 0% | 30% | 10% | 59%
tools/self-hosted-runner-utils0% | 0% | 33% | 19% | 46%
torchci/components0% | 0% | 0% | 26% | 73%
torchci/pages0% | 0% | 0% | 11% | 88%
aws/websites0% | 0% | 0% | 0% | 100%
torchci0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def extract_github_objects()
in aws/lambda/github-webhook-rds-sync/utils.py
45 18 3
def transform_data()
in aws/lambda/github-webhook-rds-sync/utils.py
38 16 2
def main()
in tools/self-hosted-runner-utils/check_runners_state.py
37 12 0
def classify()
in torchci/log_classifier/classify_log.py
48 11 2
async function runBotForLabels()
in torchci/lib/bot/autoCcBot.ts
54 11 2
def update_pending()
in tools/scripts/update_pending_hud.py
41 11 1
def run()
in torchci/log_classifier/classify_log.py
29 10 2
function genCircleParametersForPush()
in torchci/lib/bot/triggerCircleCIWorkflows.ts
53 10 2
def gh_fetch_json()
in tools/scripts/update_pending_hud.py
14 10 3
def get_column()
in aws/lambda/github-webhook-rds-sync/utils.py
21 10 3
def generate_orm()
in aws/lambda/github-webhook-rds-sync/utils.py
31 10 3
function DisableIssue()
in torchci/components/JobLinks.tsx
51 9 1
export default function JobConclusion()
in torchci/components/JobConclusion.tsx
45 9 1
export function genCircleParametersForPR()
in torchci/lib/bot/triggerCircleCIWorkflows.ts
41 9 3
def build_query()
in aws/lambda/rds-proxy/lambda_function.py
25 9 1
def compact_data()
in aws/lambda/hud-query-proxy/lambda_function.py
16 8 2
def process_builds()
in torchci/log_classifier/download_jenkins.py
31 7 1
export function parseCIFlowIssue()
in torchci/lib/bot/ciflowBot.ts
33 7 1
export function formValidationComment()
in torchci/lib/bot/verifyDisableTestIssueBot.ts
59 7 3
97 7 1