tensorflow / decision-forests
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 519 units with 7,698 lines of code in units (76.5% of code).
    • 1 very complex units (175 lines of code)
    • 1 complex units (312 lines of code)
    • 23 medium complex units (1,667 lines of code)
    • 55 simple units (1,725 lines of code)
    • 439 very simple units (3,819 lines of code)
2% | 4% | 21% | 22% | 49%
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
py4% | 0% | 21% | 24% | 50%
cc0% | 10% | 24% | 19% | 44%
js0% | 0% | 0% | 39% | 60%
h0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tensorflow_decision_forests/keras9% | 0% | 25% | 12% | 51%
tensorflow_decision_forests/keras/wrapper0% | 79% | 0% | 9% | 10%
tensorflow_decision_forests/tensorflow/ops0% | 0% | 29% | 25% | 45%
tensorflow_decision_forests/tensorflow0% | 0% | 45% | 30% | 23%
tensorflow_decision_forests/component/py_tree0% | 0% | 16% | 9% | 73%
tensorflow_decision_forests/component/builder0% | 0% | 8% | 39% | 52%
tensorflow_decision_forests/component/inspector0% | 0% | 7% | 28% | 64%
tensorflow_decision_forests/tensorflow/distribute0% | 0% | 0% | 23% | 76%
tensorflow_decision_forests/component/model_plotter0% | 0% | 0% | 41% | 58%
tools0% | 0% | 0% | 0% | 100%
configure0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def collect_data_step()
in tensorflow_decision_forests/keras/core.py
175 52 3
ydf::utils::StatusOr GenKerasPythonWrapper()
in tensorflow_decision_forests/keras/wrapper/wrapper.cc
312 40 0
def __init__()
in tensorflow_decision_forests/keras/core.py
92 23 18
def _finalize_dataspec()
in tensorflow_decision_forests/component/builder/builder.py
33 22 1
def fit_on_dataset_path()
in tensorflow_decision_forests/keras/core.py
121 20 10
tf::Status SetVerticalDataset()
in tensorflow_decision_forests/tensorflow/ops/inference/kernel.cc
99 19 3
tf::Status FeatureSet::Link()
in tensorflow_decision_forests/tensorflow/ops/training/kernel.cc
80 18 6
def _train_model()
in tensorflow_decision_forests/keras/core.py
84 17 1
def train_on_file_dataset()
in tensorflow_decision_forests/tensorflow/core.py
72 17 19
tf::Status SetExamples()
in tensorflow_decision_forests/tensorflow/ops/inference/kernel.cc
81 16 3
def core_condition_to_condition()
in tensorflow_decision_forests/component/py_tree/condition.py
50 15 2
def normalize_inputs()
in tensorflow_decision_forests/tensorflow/core.py
72 15 2
tf::Status RunInference()
in tensorflow_decision_forests/tensorflow/ops/inference/kernel.cc
80 15 4
tf::Status FeatureSet::MoveExamplesFromFeaturesToDataset()
in tensorflow_decision_forests/tensorflow/ops/training/kernel.cc
146 15 2
def _proto_evaluation_to_evaluation()
in tensorflow_decision_forests/component/inspector/inspector.py
28 14 1
def fit()
in tensorflow_decision_forests/keras/core.py
47 14 6
def collect_training_examples()
in tensorflow_decision_forests/tensorflow/core.py
54 14 4
def make_test_function()
in tensorflow_decision_forests/keras/core.py
52 13 1
def _get_matching_template()
in tensorflow_decision_forests/keras/core.py
28 13 2
def capture_cpp_log_context()
in tensorflow_decision_forests/tensorflow/tf_logging.py
45 13 1