facebookresearch / APIsynth
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 195 units with 2,774 lines of code in units (63.0% of code).
    • 1 very complex units (395 lines of code)
    • 0 complex units (0 lines of code)
    • 6 medium complex units (231 lines of code)
    • 14 simple units (223 lines of code)
    • 174 very simple units (1,925 lines of code)
14% | 0% | 8% | 8% | 69%
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% | 0% | 8% | 8% | 69%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Synthesis_incorporation/value_search33% | 0% | 9% | 14% | 42%
Synthesis_incorporation/models0% | 0% | 37% | 9% | 53%
Synthesis_incorporation0% | 0% | 0% | 100% | 0%
Synthesis_incorporation/benchmarks0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def add_filters_to_function_operation()
in Synthesis_incorporation/value_search/operation_filtering.py
395 124 1
def is_castable()
in Synthesis_incorporation/value_search/operation_filtering.py
36 22 2
def _get_predicted_values()
in Synthesis_incorporation/value_search/value_search.py
56 21 6
def TENSOR_PRIMITIVE_SAME_TYPES_APPLY_FILTER()
in Synthesis_incorporation/value_search/operation_filtering.py
23 15 1
def embed_benchmark_value()
in Synthesis_incorporation/models/prediction_model.py
34 12 2
def tensor_flatten_pad()
in Synthesis_incorporation/models/prediction_model.py
43 12 5
def predict_sequence()
in Synthesis_incorporation/models/prediction_model.py
39 12 7
def predict_first_in_sequence()
in Synthesis_incorporation/models/prediction_model.py
30 8 6
def parse_function_info_name()
in Synthesis_incorporation/torch_functions.py
22 8 1
def _contains_sparse()
in Synthesis_incorporation/value_search/value_search.py
10 8 1
def __init__()
in Synthesis_incorporation/value_search/value_search_settings.py
14 7 1
def PADDINGS_FILTER()
in Synthesis_incorporation/value_search/operation_filtering.py
14 7 1
def _print_warnings()
in Synthesis_incorporation/value_search/function_operation.py
30 7 3
def _is_valid_name()
in Synthesis_incorporation/value_search/value_search.py
11 6 1
def set()
in Synthesis_incorporation/value_search/value_search_settings.py
15 6 3
def broadcastable()
in Synthesis_incorporation/value_search/operation_filtering.py
6 6 2
def SHAPE_FILTER()
in Synthesis_incorporation/value_search/operation_filtering.py
9 6 1
def SEQUENCE_MASK_LENGTHS_FILTER()
in Synthesis_incorporation/value_search/operation_filtering.py
8 6 1
def SCATTER_INDICES_FILTER()
in Synthesis_incorporation/value_search/operation_filtering.py
9 6 1
def __init__()
in Synthesis_incorporation/value_search/function_operation.py
28 6 2