tensorflow / models
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 9,329 units with 175,682 lines of code in units (80.5% of code).
    • 4 very complex units (1,043 lines of code)
    • 25 complex units (4,124 lines of code)
    • 421 medium complex units (28,712 lines of code)
    • 1,029 simple units (38,419 lines of code)
    • 7,850 very simple units (103,384 lines of code)
<1% | 2% | 16% | 21% | 58%
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
py<1% | 2% | 16% | 21% | 58%
cc0% | 0% | 14% | 31% | 54%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
official/nlp2% | 3% | 17% | 19% | 56%
research/object_detection1% | 2% | 19% | 23% | 53%
research/slim0% | 8% | 19% | 22% | 48%
research/efficient-hrl0% | 13% | 14% | 19% | 52%
research/delf0% | 9% | 28% | 16% | 45%
research/lstm_object_detection0% | 4% | 15% | 23% | 55%
official/legacy0% | <1% | 17% | 20% | 60%
research/lfads0% | 5% | 31% | 16% | 46%
research/pcl_rl0% | 4% | 22% | 19% | 53%
research/vid2depth0% | 3% | 10% | 13% | 71%
official/vision0% | 0% | 11% | 23% | 65%
official/projects0% | 0% | 10% | 23% | 65%
research/deeplab0% | 0% | 29% | 19% | 50%
research/cognitive_planning0% | 0% | 19% | 32% | 48%
research/seq_flow_lite0% | 0% | 13% | 21% | 65%
official/recommendation0% | 0% | 16% | 14% | 68%
official/utils0% | 0% | 37% | 7% | 54%
official/modeling0% | 0% | 11% | 23% | 64%
official/core0% | 0% | 13% | 27% | 58%
research/cvt_text0% | 0% | 10% | 29% | 60%
research/adversarial_text0% | 0% | 6% | 25% | 67%
research/rebar0% | 0% | 10% | 14% | 75%
research/autoaugment0% | 0% | 7% | 9% | 83%
research/attention_ocr0% | 0% | 6% | 11% | 82%
official/common0% | 0% | 26% | 13% | 60%
research/audioset0% | 0% | 0% | 23% | 76%
orbit0% | 0% | 0% | 24% | 75%
orbit/utils0% | 0% | 0% | 24% | 75%
research/deep_speech0% | 0% | 0% | 5% | 94%
orbit/actions0% | 0% | 0% | 13% | 86%
official/pip_package0% | 0% | 0% | 100% | 0%
research/marco0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def build()
in research/object_detection/builders/preprocessor_builder.py
266 87 1
def convert_examples_to_features()
in official/nlp/data/squad_lib_sp.py
289 82 10
def convert_examples_to_features()
in official/nlp/xlnet/squad_utils.py
247 72 8
def create_model_fn()
in research/object_detection/model_lib.py
241 57 5
def main()
in research/delf/delf/python/training/train.py
255 50 1
def convert_examples_to_features()
in official/nlp/data/squad_lib.py
182 46 9
def main()
in research/delf/delf/python/training/global_features/train.py
169 44 1
def train()
in official/nlp/xlnet/training_utils.py
180 42 19
def s3dg_base()
in research/slim/nets/s3dg.py
265 40 9
def postprocess_output()
in official/nlp/data/squad_lib.py
164 39 10
def call()
in official/nlp/xlnet/xlnet_modeling.py
142 39 2
def batch_multiclass_non_max_suppression()
in research/object_detection/core/post_processing.py
225 39 22
def postprocess_output()
in official/nlp/data/squad_lib_sp.py
152 37 10
def sample_expert_path()
in research/pcl_rl/expert_paths.py
101 37 2
def train()
in official/legacy/transformer/transformer_main.py
132 32 1
def __init__()
in research/efficient-hrl/environments/maze_env.py
181 31 13
def eval_model_runs_batch()
in research/lfads/lfads.py
101 31 6
def _run_checkpoint_once()
in research/object_detection/eval_util.py
102 31 13
def _maybe_update_config_with_key_value()
in research/object_detection/utils/config_util.py
70 30 3
def inception_v2_base()
in research/slim/nets/inception_v2.py
363 30 8