facebookresearch / dynabench
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,391 units with 22,342 lines of code in units (47.9% of code).
    • 1 very complex units (221 lines of code)
    • 10 complex units (1,729 lines of code)
    • 48 medium complex units (4,328 lines of code)
    • 134 simple units (4,595 lines of code)
    • 1,198 very simple units (11,469 lines of code)
<1% | 7% | 19% | 20% | 51%
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% | 5% | 13% | 24% | 54%
js0% | 10% | 28% | 14% | 45%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
api/models10% | 5% | 6% | 5% | 72%
frontends/web0% | 10% | 28% | 14% | 45%
api/migrations0% | 86% | 0% | 0% | 13%
api/controllers0% | 5% | 31% | 31% | 30%
evaluation/datasets0% | 16% | 0% | 6% | 76%
api0% | 2% | 15% | 20% | 61%
evaluation/utils0% | 0% | 27% | 21% | 51%
legacy/torchserve0% | 0% | 5% | 34% | 59%
evaluation/metrics0% | 0% | 33% | 24% | 42%
api/common0% | 0% | 21% | 8% | 69%
api/cron0% | 0% | 23% | 26% | 50%
builder/utils0% | 0% | 0% | 68% | 31%
evaluation/scripts0% | 0% | 0% | 36% | 63%
ROOT0% | 0% | 0% | 71% | 28%
evaluation0% | 0% | 0% | 100% | 0%
api/tools0% | 0% | 0% | 40% | 59%
legacy/modelservers0% | 0% | 0% | 0% | 100%
annotators0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def handleAsync()
in api/models/badge.py
221 67 1
def validate_example()
in api/controllers/validations.py
127 43 2
render()
in frontends/web/src/containers/ModelPage.js
347 39 0
handleResponse()
in frontends/web/src/common/Annotation/CreateInterface.js
174 35 1
def apply_step()
in api/migrations/20210105_populate-total-verified-not-correct-fooled-column.py
135 33 1
render()
in frontends/web/src/common/Annotation/ResponseInfo.js
400 31 0
def apply_step()
in api/migrations/20201116_populate-total-verified-not-fooled-column.py
131 30 1
def apply_step()
in api/migrations/20210127_01_sHlix-add-round-user-example-info-table.py
168 30 1
def handleCreateInterface()
in api/models/badge.py
114 28 3
def _cast()
in api/bottle.py
56 28 3
def eval()
in evaluation/datasets/common.py
77 28 4
These Terms of Use()
in frontends/web/src/containers/TermsPage.js
271 23 1
agree to()
in frontends/web/src/containers/TermsPage.js
265 23 1
def do_upload_via_predictions()
in api/controllers/models.py
87 22 3
def update_status()
in evaluation/utils/evaluator.py
81 22 1
render()
in frontends/web/src/containers/TaskOwnerPage.js
130 21 0
def create()
in api/controllers/datasets.py
107 21 3
Excluding any User Content and User Models()
in frontends/web/src/containers/TermsPage.js
249 20 1
that you may Submit()
in frontends/web/src/containers/TermsPage.js
248 20 1
interactions you may have with our AI systems()
in frontends/web/src/containers/TermsPage.js
233 20 2