tensorflow / neural-structured-learning
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 882 units with 13,827 lines of code in units (71.3% of code).
    • 0 very complex units (0 lines of code)
    • 6 complex units (871 lines of code)
    • 43 medium complex units (2,513 lines of code)
    • 89 simple units (2,946 lines of code)
    • 744 very simple units (7,497 lines of code)
0% | 6% | 18% | 21% | 54%
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% | 7% | 18% | 21% | 52%
cc0% | 2% | 18% | 20% | 58%
h0% | 0% | 9% | 15% | 74%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
research/gam0% | 9% | 26% | 23% | 40%
research/a2n0% | 20% | 13% | 20% | 45%
research/carls0% | 4% | 16% | 17% | 62%
neural_structured_learning/estimator0% | 0% | 100% | 0% | 0%
research/kg_hyp_emb0% | 0% | 13% | 4% | 82%
neural_structured_learning/lib0% | 0% | 16% | 32% | 51%
research/multi_representation_adversary0% | 0% | 10% | 32% | 57%
neural_structured_learning/keras0% | 0% | 9% | 35% | 55%
neural_structured_learning/tools0% | 0% | 14% | 28% | 57%
research/gnn-survey0% | 0% | 0% | 20% | 79%
research/neural_clustering0% | 0% | 0% | 36% | 63%
neural_structured_learning/experimental0% | 0% | 0% | 25% | 75%
neural_structured_learning/configs0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def __init__()
in research/gam/gam/trainer/trainer_classification.py
204 32 38
def train()
in research/gam/gam/trainer/trainer_cotrain.py
190 29 3
std::string DebugString()
in research/carls/base/input_context_helper.cc
88 28 1
def embed_single_feature()
in research/carls/models/caml/sparse_features.py
102 28 9
def evaluate()
in research/a2n/train.py
217 28 0
def read_graph()
in research/a2n/graph.py
70 26 2
def train()
in research/gam/gam/trainer/trainer_classification.py
107 25 4
def main()
in research/gam/gam/experiments/run_train_gam_graph.py
133 25 1
def featurize_each_example()
in research/a2n/dataset.py
91 23 2
def __init__()
in research/gam/gam/trainer/trainer_agreement.py
146 22 33
def main()
in research/gam/gam/experiments/run_train_gam.py
132 22 1
absl::Status Prune()
in research/carls/base/input_context_helper.cc
54 21 3
def train()
in research/gam/gam/trainer/trainer_classification_gcn.py
95 21 4
def main()
in research/kg_hyp_emb/train.py
102 19 1
def add_graph_regularization()
in neural_structured_learning/estimator/graph_regularization.py
65 18 4
def _prepare_loss_fns()
in neural_structured_learning/keras/adversarial_regularization.py
15 18 2
def __init__()
in research/gam/gam/trainer/trainer_classification_gcn.py
234 18 38
def random_in_norm_ball()
in neural_structured_learning/lib/utils.py
36 17 3
Status KnowledgeBankGrpcServiceImpl::StartSessionIfNecessary()
in research/carls/knowledge_bank_grpc_service.cc
56 17 3
def build()
in research/carls/dynamic_normalization.py
33 17 2