tensorflow / datasets
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 2,817 units with 34,142 lines of code in units (64.9% of code).
    • 1 very complex units (500 lines of code)
    • 1 complex units (535 lines of code)
    • 45 medium complex units (2,030 lines of code)
    • 183 simple units (4,666 lines of code)
    • 2,587 very simple units (26,411 lines of code)
1% | 1% | 5% | 13% | 77%
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% | 5% | 13% | 77%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tensorflow_datasets/text8% | 9% | 8% | 9% | 63%
tensorflow_datasets/core0% | 0% | 7% | 18% | 74%
tensorflow_datasets/vision_language0% | 0% | 23% | 7% | 68%
tensorflow_datasets/image_classification0% | 0% | 2% | 10% | 86%
tensorflow_datasets/testing0% | 0% | 5% | 13% | 80%
tensorflow_datasets/translate0% | 0% | 13% | 15% | 70%
tensorflow_datasets/image0% | 0% | 5% | 17% | 77%
tensorflow_datasets/audio0% | 0% | 5% | 10% | 83%
tensorflow_datasets/question_answering0% | 0% | 9% | 21% | 68%
tensorflow_datasets/summarization0% | 0% | 7% | 2% | 89%
tensorflow_datasets/text_simplification0% | 0% | 34% | 10% | 54%
tensorflow_datasets/object_detection0% | 0% | 3% | 25% | 70%
tensorflow_datasets/video0% | 0% | 9% | 27% | 62%
tensorflow_datasets/ranking0% | 0% | 28% | 5% | 65%
tensorflow_datasets/scripts0% | 0% | 2% | 9% | 88%
tensorflow_datasets/structured0% | 0% | 0% | 9% | 90%
tensorflow_datasets/d4rl0% | 0% | 0% | 37% | 62%
tensorflow_datasets/robomimic0% | 0% | 0% | 47% | 52%
tensorflow_datasets/rlds0% | 0% | 0% | 15% | 84%
tensorflow_datasets/graphs0% | 0% | 0% | 6% | 93%
tensorflow_datasets/rl_unplugged0% | 0% | 0% | 0% | 100%
tensorflow_datasets/time_series0% | 0% | 0% | 0% | 100%
tensorflow_datasets0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _generate_examples()
in tensorflow_datasets/text/gem/gem.py
500 106 5
def _split_generators()
in tensorflow_datasets/text/gem/gem.py
535 26 2
def split_wet_file()
in tensorflow_datasets/text/c4_utils.py
60 24 2
def _generate_examples()
in tensorflow_datasets/vision_language/wit_kaggle/wit_kaggle.py
108 22 5
def _get_page_content()
in tensorflow_datasets/text/c4.py
84 20 4
def _str_to_relative_instruction()
in tensorflow_datasets/core/splits.py
47 19 1
def _generate_examples()
in tensorflow_datasets/audio/speech_commands.py
37 18 3
def _generate_examples()
in tensorflow_datasets/text/glue.py
37 18 4
def _generate_examples()
in tensorflow_datasets/translate/wmt.py
53 18 3
def _generate_examples()
in tensorflow_datasets/text_simplification/wiki_auto/wiki_auto.py
80 17 3
def read_from_directory()
in tensorflow_datasets/core/dataset_info.py
57 17 2
def _generate_blended_split_builder_configs()
in tensorflow_datasets/text/star_cfq/star_cfq.py
37 17 0
def _should_cache_ds()
in tensorflow_datasets/core/dataset_builder.py
13 16 4
def _build_from_token_counts()
in tensorflow_datasets/core/deprecated/text/subword_text_encoder.py
34 16 6
def _to_tf_example_spec()
in tensorflow_datasets/core/example_parser.py
44 15 1
def _deduplicate()
in tensorflow_datasets/text/reddit_disentanglement.py
20 15 1
def clean_page()
in tensorflow_datasets/text/c4_utils.py
52 15 6
def _generate_examples()
in tensorflow_datasets/vision_language/refcoco/refcoco.py
41 15 4
def _generate_examples()
in tensorflow_datasets/summarization/wikihow.py
28 14 3
def _generate_examples()
in tensorflow_datasets/question_answering/trivia_qa.py
91 14 4