facebookresearch / Mephisto
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,070 units with 10,752 lines of code in units (43.1% of code).
    • 0 very complex units (0 lines of code)
    • 4 complex units (754 lines of code)
    • 23 medium complex units (1,597 lines of code)
    • 34 simple units (1,235 lines of code)
    • 1,009 very simple units (7,166 lines of code)
0% | 7% | 14% | 11% | 66%
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
js0% | 20% | 23% | 9% | 47%
py0% | 2% | 12% | 12% | 72%
ts0% | 0% | 0% | 51% | 48%
tsx0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
packages/annotation-toolkit0% | 28% | 32% | 9% | 29%
packages/annotated0% | 30% | 29% | 9% | 31%
mephisto/scripts0% | 36% | 54% | 0% | 9%
mephisto/abstractions0% | 1% | 2% | 10% | 84%
mephisto/client0% | 0% | 22% | 10% | 66%
mephisto/data_model0% | 0% | 20% | 3% | 76%
mephisto/operations0% | 0% | 19% | 25% | 54%
packages/mephisto-review-hook0% | 0% | 54% | 41% | 3%
mephisto/tools0% | 0% | 0% | 35% | 64%
packages/mephisto-task0% | 0% | 0% | 0% | 100%
hydra_plugins0% | 0% | 0% | 0% | 100%
packages/cra-template-mephisto-review0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
export default function MovableRect()
in packages/annotation-toolkit/src/layers/MovableRect.js
288 50 8
export default function MovableRect()
in packages/annotated/bbox/src/MovableRect.js
286 48 8
def main()
in mephisto/scripts/mturk/identify_broken_units.py
97 31 0
def build_and_return_custom_bundle()
in mephisto/abstractions/blueprints/parlai_chat/parlai_chat_task_builder.py
83 28 2
function ContentPanel()
in packages/annotated/shell/src/panels/ContentPanel.js
147 25 1
function ContentPanel()
in packages/annotation-toolkit/src/panels/ContentPanel.js
147 25 1
def get_help_arguments()
in mephisto/client/cli.py
103 23 1
def get_valid_units_for_worker()
in mephisto/data_model/task_run.py
59 21 2
export default function VideoPlayer()
in packages/annotation-toolkit/src/layers/VideoPlayer.js
177 20 8
def _register_agent()
in mephisto/operations/supervisor.py
146 18 3
def main()
in mephisto/scripts/mturk/launch_makeup_hits.py
146 18 0
def consume_all_data()
in mephisto/client/review/review_server.py
39 16 3
def task_data_by_id()
in mephisto/client/review/review_server.py
49 16 1
function useMephistoReview()
in packages/mephisto-review-hook/src/index.js
57 16 8
def on_message()
in mephisto/abstractions/architects/router/flask/mephisto_flask_blueprint.py
59 15 2
def as_valid_qualification_dict()
in mephisto/data_model/qualification.py
48 14 2
def get_status()
in mephisto/data_model/unit.py
41 14 1
function formatMessage()
in packages/annotated/dev-scripts/utils/formatWebpackMessages.js
73 14 1
def get_status()
in mephisto/data_model/assignment.py
23 13 1
def extract_unique_mixins()
in mephisto/abstractions/blueprint.py
27 13 1