tensorflow / docs
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 339 units with 2,987 lines of code in units (43.5% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 13 medium complex units (377 lines of code)
    • 39 simple units (789 lines of code)
    • 287 very simple units (1,821 lines of code)
0% | 0% | 12% | 26% | 60%
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% | 12% | 24% | 62%
cs0% | 0% | 0% | 100% | 0%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tools/tensorflow_docs/api_generator0% | 0% | 11% | 25% | 62%
tools/tensorflow_docs/tools0% | 0% | 19% | 25% | 54%
tools/tensorflow_docs/plots0% | 0% | 0% | 71% | 28%
tools/tensorflow_docs/vis0% | 0% | 0% | 35% | 64%
tools/templates0% | 0% | 0% | 0% | 100%
tools/tensorflow_docs/modeling0% | 0% | 0% | 0% | 100%
tools/release_tools0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def generate_global_index()
in tools/tensorflow_docs/api_generator/parser.py
38 16 3
def _add_proto_fields()
in tools/tensorflow_docs/api_generator/traverse.py
46 16 3
def clean_cells()
in tools/tensorflow_docs/tools/nbfmt/__main__.py
27 16 4
def __str__()
in tools/tensorflow_docs/tools/nblint/linter.py
23 14 1
def _one_ref()
in tools/tensorflow_docs/api_generator/reference_resolver.py
21 13 3
def _is_private()
in tools/tensorflow_docs/api_generator/public_api.py
19 12 5
def merge_blocks()
in tools/tensorflow_docs/api_generator/pretty_docs/class_page.py
18 12 2
def _maybe_find_duplicates()
in tools/tensorflow_docs/api_generator/doc_generator_visitor.py
30 12 1
def _dfs()
in tools/tensorflow_docs/api_generator/generate_lib.py
15 11 4
def get_defined_in()
in tools/tensorflow_docs/api_generator/parser.py
49 11 2
def _score_name()
in tools/tensorflow_docs/api_generator/doc_generator_visitor.py
28 11 2
def _run_lint_group()
in tools/tensorflow_docs/tools/nblint/linter.py
27 11 7
def run()
in tools/tensorflow_docs/tools/nblint/linter.py
36 11 5
def _create_partial_symbols_dict()
in tools/tensorflow_docs/api_generator/reference_resolver.py
20 10 1
def _augment_attributes()
in tools/tensorflow_docs/api_generator/pretty_docs/class_page.py
26 10 2
def _traverse_internal()
in tools/tensorflow_docs/api_generator/traverse.py
19 10 4
def main()
in tools/tensorflow_docs/tools/nblint/__main__.py
27 10 1
def lint_params()
in tools/tensorflow_docs/api_generator/report/linter.py
26 9 1
def explicit_package_contents_filter()
in tools/tensorflow_docs/api_generator/public_api.py
17 9 3
def should_skip_class_attr()
in tools/tensorflow_docs/api_generator/doc_controls.py
28 9 2