tensorflow / estimator
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 1,771 units with 26,135 lines of code in units (90.3% of code).
    • 1 very complex units (299 lines of code)
    • 3 complex units (306 lines of code)
    • 52 medium complex units (3,060 lines of code)
    • 152 simple units (4,557 lines of code)
    • 1,563 very simple units (17,913 lines of code)
1% | 1% | 11% | 17% | 68%
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
py1% | 1% | 11% | 17% | 68%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tensorflow_estimator/python/estimator/tpu8% | 4% | 21% | 19% | 46%
tensorflow_estimator/python/estimator/inputs0% | 21% | 29% | 18% | 31%
tensorflow_estimator/python/estimator/canned0% | 0% | 6% | 12% | 81%
tensorflow_estimator/python/estimator0% | 0% | 21% | 33% | 45%
tensorflow_estimator/python/estimator/head0% | 0% | 15% | 24% | 60%
tensorflow_estimator/python/estimator/tools0% | 0% | 64% | 20% | 14%
tensorflow_estimator/python/estimator/hooks0% | 0% | 15% | 23% | 61%
tensorflow_estimator/python/estimator/export0% | 0% | 0% | 22% | 77%
tensorflow_estimator/tools/pip_package0% | 0% | 0% | 68% | 31%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _augment_model_fn()
in tensorflow_estimator/python/estimator/tpu/tpu_estimator.py
299 67 3
def _enqueue_data()
in tensorflow_estimator/python/estimator/inputs/queues/feeding_functions.py
122 35 10
def __init__()
in tensorflow_estimator/python/estimator/tpu/tpu_estimator.py
95 28 16
def _validate_tpu_configuration()
in tensorflow_estimator/python/estimator/tpu/tpu_context.py
89 27 1
def convert_checkpoint()
in tensorflow_estimator/python/estimator/tools/checkpoint_converter.py
52 25 4
def _create_keras_model_fn()
in tensorflow_estimator/python/estimator/keras_lib.py
83 23 5
def _combine_distributed_scaffold()
in tensorflow_estimator/python/estimator/estimator.py
63 22 2
def _validate_eval_metric_ops()
in tensorflow_estimator/python/estimator/model_fn.py
40 21 1
def _invoke_input_fn_and_record_structure()
in tensorflow_estimator/python/estimator/tpu/tpu_estimator.py
85 21 1
def __init__()
in tensorflow_estimator/python/estimator/head/multi_label_head.py
90 21 9
def _convert_estimator_io_to_keras()
in tensorflow_estimator/python/estimator/keras_lib.py
49 20 3
def model_to_estimator()
in tensorflow_estimator/python/estimator/keras_lib.py
79 20 9
def __new__()
in tensorflow_estimator/python/estimator/tpu/_tpu_estimator_embedding.py
70 20 10
def get_weights_and_check_match_logits()
in tensorflow_estimator/python/estimator/head/base_head.py
83 20 4
def _dnn_linear_combined_model_fn_v2()
in tensorflow_estimator/python/estimator/canned/dnn_linear_combined.py
92 20 15
def _canonicalize_numpy_data()
in tensorflow_estimator/python/estimator/canned/timeseries/saved_model_utils.py
54 20 2
def pandas_input_fn()
in tensorflow_estimator/python/estimator/inputs/pandas_io.py
67 18 8
def numpy_input_fn()
in tensorflow_estimator/python/estimator/inputs/numpy_io.py
67 18 7
def _add_meta_graph_for_mode()
in tensorflow_estimator/python/estimator/estimator.py
73 17 9
def generate_broadcast_enqueue_ops_fn()
in tensorflow_estimator/python/estimator/tpu/tpu_estimator.py
73 17 4