awslabs / gap-text2sql
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 860 units with 11,601 lines of code in units (75.0% of code).
    • 4 very complex units (529 lines of code)
    • 8 complex units (836 lines of code)
    • 38 medium complex units (2,212 lines of code)
    • 90 simple units (2,104 lines of code)
    • 720 very simple units (5,920 lines of code)
4% | 7% | 19% | 18% | 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
py4% | 7% | 19% | 18% | 51%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
relogic/pretrainkit34% | 0% | 0% | 25% | 40%
rat-sql-gap/seq2struct/models2% | 10% | 25% | 9% | 51%
relogic/pretrainkit/models5% | 0% | 16% | 13% | 64%
relogic0% | 89% | 0% | 0% | 10%
relogic/pretrainkit/datasets0% | 14% | 24% | 23% | 36%
relogic/logickit/utils0% | 15% | 0% | 10% | 74%
rat-sql-gap/seq2struct/grammars0% | 0% | 57% | 16% | 26%
rat-sql-gap/seq2struct/datasets0% | 0% | 15% | 44% | 40%
rat-sql-gap/seq2struct0% | 0% | 29% | 27% | 42%
rat-sql-gap/seq2struct/utils0% | 0% | 8% | 19% | 71%
rat-sql-gap/seq2struct/commands0% | 0% | 0% | 23% | 76%
rat-sql-gap0% | 0% | 0% | 85% | 15%
rat-sql-gap/seq2struct/resources0% | 0% | 0% | 14% | 85%
relogic/pretrainkit/scorers0% | 0% | 0% | 0% | 100%
relogic/logickit/base0% | 0% | 0% | 0% | 100%
relogic/logickit/modules0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def train()
in relogic/pretrainkit/multitask_trainer.py
151 63 2
def train()
in relogic/pretrainkit/trainer.py
150 55 2
def compute_relations()
in rat-sql-gap/seq2struct/models/spider/spider_enc_modules.py
114 51 7
def compute_relations()
in relogic/pretrainkit/models/relationalsemparse/relational_transformer.py
114 51 7
def beam_search_with_heuristics()
in rat-sql-gap/seq2struct/models/spider/spider_beam_search.py
137 41 6
def forward()
in rat-sql-gap/seq2struct/models/spider/spider_enc.py
133 37 2
def forward()
in rat-sql-gap/seq2struct/models/spider/spider_enc.py
128 36 2
def main()
in relogic/entity-to-text-train.py
89 33 0
def main()
in relogic/sql-to-text-train.py
89 33 0
def main()
in relogic/logical-tabart-pretraining.py
110 33 0
def get_span_labels()
in relogic/logickit/utils/utils.py
32 28 5
def __init__()
in relogic/pretrainkit/datasets/semparse/rat_text2sql.py
118 26 5
def verify_ast()
in rat-sql-gap/seq2struct/ast_util.py
56 25 4
def compute_schema_linking()
in rat-sql-gap/seq2struct/models/spider/spider_match_utils.py
55 25 3
def beam_search_with_oracle_column()
in rat-sql-gap/seq2struct/models/spider/spider_beam_search.py
71 23 6
def get_keywords()
in rat-sql-gap/seq2struct/datasets/spider_lib/evaluation.py
30 22 1
def dump_db_json_schema()
in rat-sql-gap/seq2struct/datasets/spider_lib/preprocess/get_tables.py
41 21 2
def compute_mle_loss()
in rat-sql-gap/seq2struct/models/nl2code/decoder.py
86 21 5
def forward()
in rat-sql-gap/seq2struct/models/spider/spider_enc.py
71 20 2
def __init__()
in relogic/pretrainkit/models/relationalsemparse/relational_transformer.py
142 20 24