tensorflow / recommenders
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 88 units with 1,056 lines of code in units (75.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (48 lines of code)
    • 14 simple units (305 lines of code)
    • 73 very simple units (703 lines of code)
0% | 0% | 4% | 28% | 66%
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% | 4% | 28% | 66%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tensorflow_recommenders/tasks0% | 0% | 38% | 32% | 28%
tensorflow_recommenders/layers/embedding0% | 0% | 0% | 59% | 40%
tensorflow_recommenders/experimental/layers0% | 0% | 0% | 91% | 8%
tensorflow_recommenders/layers0% | 0% | 0% | 9% | 90%
tensorflow_recommenders/experimental/optimizers0% | 0% | 0% | 46% | 53%
tools0% | 0% | 0% | 52% | 47%
tensorflow_recommenders/layers/feature_interaction0% | 0% | 0% | 13% | 86%
tensorflow_recommenders/experimental/models0% | 0% | 0% | 0% | 100%
tensorflow_recommenders/models0% | 0% | 0% | 0% | 100%
tensorflow_recommenders/metrics0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def call()
in tensorflow_recommenders/tasks/retrieval.py
48 14 8
def call()
in tensorflow_recommenders/layers/factorized_top_k.py
30 9 5
def translate_keras_optimizer()
in tensorflow_recommenders/layers/embedding/tpu_embedding_layer.py
23 9 1
def _hide_layer_and_module_methods()
in tools/build_api_docs.py
19 8 0
def _get_batch_size_from_input_shapes()
in tensorflow_recommenders/layers/embedding/tpu_embedding_layer.py
26 8 1
def _normalize_and_prepare_optimizer()
in tensorflow_recommenders/layers/embedding/tpu_embedding_layer.py
25 8 1
def call()
in tensorflow_recommenders/layers/embedding/tpu_embedding_layer.py
23 8 4
def call()
in tensorflow_recommenders/experimental/layers/embedding/partial_tpu_embedding.py
19 8 3
def call()
in tensorflow_recommenders/tasks/ranking.py
26 8 6
def build()
in tensorflow_recommenders/layers/embedding/tpu_embedding_layer.py
19 7 2
def apply_gradients()
in tensorflow_recommenders/experimental/optimizers/composite_optimizer.py
25 7 5
def _ensure_unsupported_params_unchanged()
in tensorflow_recommenders/layers/embedding/tpu_embedding_layer.py
16 6 3
def call()
in tensorflow_recommenders/layers/feature_interaction/dcn.py
17 6 3
def __init__()
in tensorflow_recommenders/experimental/layers/embedding/partial_tpu_embedding.py
22 6 6
def __init__()
in tensorflow_recommenders/tasks/ranking.py
15 6 7
def index()
in tensorflow_recommenders/layers/factorized_top_k.py
27 5 3
def _clone_and_prepare_features()
in tensorflow_recommenders/layers/embedding/tpu_embedding_layer.py
25 5 1
def call()
in tensorflow_recommenders/layers/feature_interaction/dot_interaction.py
30 5 2
def __init__()
in tensorflow_recommenders/experimental/models/ranking.py
33 5 6
def call()
in tensorflow_recommenders/layers/loss.py
8 4 3