tensorflow / ranking
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 473 units with 5,751 lines of code in units (85.2% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (101 lines of code)
    • 7 medium complex units (413 lines of code)
    • 41 simple units (1,162 lines of code)
    • 424 very simple units (4,075 lines of code)
0% | 1% | 7% | 20% | 70%
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% | 1% | 7% | 20% | 70%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tensorflow_ranking/python0% | 3% | 9% | 22% | 65%
tensorflow_ranking/python/keras0% | 0% | 4% | 14% | 81%
tensorflow_ranking/python/keras/canned0% | 0% | 23% | 57% | 18%
tensorflow_ranking/extension/premade0% | 0% | 0% | 34% | 65%
tensorflow_ranking/extension0% | 0% | 0% | 7% | 92%
tensorflow_ranking/research0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def parse()
in tensorflow_ranking/python/data.py
101 30 2
def model_to_estimator()
in tensorflow_ranking/python/keras/estimator.py
76 15 7
def _make_gam_score_fn()
in tensorflow_ranking/python/estimator.py
71 14 6
def make_loss_fn()
in tensorflow_ranking/python/losses.py
91 14 8
def build_ranking_dataset_with_parsing_fn()
in tensorflow_ranking/python/data.py
41 14 14
def score()
in tensorflow_ranking/python/keras/canned/gam.py
45 13 4
def _compute_logits_impl()
in tensorflow_ranking/python/model.py
48 12 7
def parse()
in tensorflow_ranking/python/data.py
41 12 2
def _model_fn()
in tensorflow_ranking/python/estimator.py
25 10 1
def encode_features()
in tensorflow_ranking/python/feature.py
32 10 4
def encode_listwise_features()
in tensorflow_ranking/python/feature.py
51 10 6
def _merge_predict_export_outputs()
in tensorflow_ranking/python/head.py
20 10 2
def listwise_scoring()
in tensorflow_ranking/python/keras/network.py
32 10 5
def __init__()
in tensorflow_ranking/python/estimator.py
28 9 8
def __init__()
in tensorflow_ranking/python/head.py
19 9 3
def sample()
in tensorflow_ranking/python/losses_impl.py
48 9 4
def __call__()
in tensorflow_ranking/python/keras/model.py
33 9 1
def _get_scalar_default_value()
in tensorflow_ranking/python/data.py
12 9 2
def _check_logits_and_labels()
in tensorflow_ranking/python/head.py
19 8 3
def sort_by_scores()
in tensorflow_ranking/python/utils.py
24 8 6