facebookresearch / NeuralDB
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 158 units with 3,004 lines of code in units (48.7% of code).
    • 3 very complex units (443 lines of code)
    • 5 complex units (553 lines of code)
    • 20 medium complex units (954 lines of code)
    • 12 simple units (263 lines of code)
    • 118 very simple units (791 lines of code)
14% | 18% | 31% | 8% | 26%
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
py14% | 18% | 31% | 8% | 26%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
dataset-construction/src/ndb_data/generation43% | 0% | 34% | 2% | 20%
modelling/src/neuraldb18% | 23% | 27% | 14% | 15%
modelling/src/neuraldb/dataset0% | 38% | 0% | 16% | 44%
ssg0% | 51% | 24% | 9% | 14%
dataset-construction/src/ndb_data/construction0% | 21% | 58% | 6% | 13%
modelling/src/neuraldb/evaluation0% | 0% | 79% | 0% | 20%
dataset-construction/src/ndb_data/util0% | 0% | 69% | 25% | 5%
modelling/src/neuraldb/retriever0% | 0% | 0% | 0% | 100%
dataset-construction/src/ndb_data/data_import0% | 0% | 0% | 0% | 100%
dataset-construction/src/ndb_data/wikidata_common0% | 0% | 0% | 0% | 100%
dataset-construction/src/ndb_data0% | 0% | 0% | 0% | 100%
modelling/src/neuraldb/modelling0% | 0% | 0% | 0% | 100%
modelling/src/neuraldb/util0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def generate_answers()
in dataset-construction/src/ndb_data/generation/question_to_db.py
132 58 3
def generate_answers()
in modelling/src/neuraldb/convert_spj_to_predictions.py
131 57 2
def generate_facts_for_db()
in dataset-construction/src/ndb_data/generation/question_to_db.py
180 57 1
def main()
in modelling/src/neuraldb/run.py
170 38 0
def _process_query()
in modelling/src/neuraldb/dataset/instance_generator/spj_generator.py
91 29 3
def build_questions_for_db()
in dataset-construction/src/ndb_data/construction/make_questions.py
86 28 1
def evaluate_ndb_with_ssg()
in ssg/evaluate_set_ssg.py
101 27 1
def __call__()
in modelling/src/neuraldb/dataset/data_collator_seq2seq.py
105 26 2
def get_baseline_evaluation()
in modelling/src/neuraldb/evaluation/postprocess_baselines.py
110 25 3
def get_spj_evaluation()
in modelling/src/neuraldb/evaluation/postprocess_spj.py
90 22 3
def generate_joins_filter()
in dataset-construction/src/ndb_data/construction/make_questions.py
44 21 8
def check_match()
in dataset-construction/src/ndb_data/generation/finalize_hypothesis.py
42 20 2
def create_dataset()
in ssg/ssg_utils.py
48 20 1
def generate_joins_extra()
in dataset-construction/src/ndb_data/construction/make_questions.py
62 19 8
def generate_derivations()
in dataset-construction/src/ndb_data/construction/make_questions.py
43 17 2
def find_longest_match()
in dataset-construction/src/ndb_data/generation/map_kelm.py
34 17 3
def generate_negative_bool()
in dataset-construction/src/ndb_data/construction/make_questions.py
42 14 3
def load_experiment()
in modelling/src/neuraldb/final_scoring_with_dbsize_sweep.py
54 13 2
def load_experiment()
in modelling/src/neuraldb/final_scoring_with_dbsize.py
54 13 1
def read_csv()
in dataset-construction/src/ndb_data/util/build_json.py
25 13 1