awslabs / recurrent-intensity-model-experiments
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 245 units with 2,315 lines of code in units (76.7% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (28 lines of code)
    • 22 simple units (514 lines of code)
    • 222 very simple units (1,773 lines of code)
0% | 0% | 1% | 22% | 76%
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
py0% | 0% | 1% | 22% | 76%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/rime0% | 0% | 12% | 25% | 62%
src/rime/util0% | 0% | 0% | 26% | 73%
src/rime/models/zero_shot0% | 0% | 0% | 72% | 27%
src/rime/models0% | 0% | 0% | 13% | 86%
src/rime/dataset0% | 0% | 0% | 12% | 87%
src/rime/metrics0% | 0% | 0% | 11% | 88%
data0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def run()
in src/rime/__init__.py
28 12 6
def eval()
in src/rime/util/score_array.py
31 10 2
def registered()
in src/rime/__init__.py
46 9 1
def dual_solve_u()
in src/rime/util/cvx_bisect.py
32 9 7
def __init__()
in src/rime/models/zero_shot/item_knn.py
32 9 9
def _compute_embeddings()
in src/rime/models/zero_shot/item_knn.py
24 9 2
def create_matrix()
in src/rime/util/__init__.py
18 8 4
def fill_factory_inplace()
in src/rime/util/__init__.py
8 8 3
def _compute_log_p_x_given_y()
in src/rime/models/zero_shot/bayes_lm.py
26 8 4
def _collate_fn()
in src/rime/models/rnn.py
10 8 4
def fit()
in src/rime/models/graph_conv.py
34 8 2
def get_mtch_()
in src/rime/__init__.py
13 7 4
def auto_cast_lazy_score()
in src/rime/util/score_array.py
15 7 1
def _get_cuda_objs()
in src/rime/util/__init__.py
10 7 0
def _argsort()
in src/rime/util/__init__.py
22 7 3
def __init__()
in src/rime/models/graph_conv.py
29 7 19
def prepare_minimal_dataset()
in src/rime/dataset/__init__.py
37 6 0
def reindex()
in src/rime/util/score_array.py
26 6 4
def groupby_collect()
in src/rime/util/__init__.py
15 6 1
def explode_user_titles()
in src/rime/util/__init__.py
15 6 5