tensorflow / ngraph-bridge
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 342 units with 6,694 lines of code in units (70.2% of code).
    • 1 very complex units (349 lines of code)
    • 3 complex units (450 lines of code)
    • 22 medium complex units (1,624 lines of code)
    • 32 simple units (1,058 lines of code)
    • 284 very simple units (3,213 lines of code)
5% | 6% | 24% | 15% | 47%
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
cc6% | 7% | 21% | 14% | 49%
py0% | 5% | 33% | 20% | 40%
h0% | 0% | 12% | 11% | 76%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
ngraph_bridge7% | 7% | 20% | 13% | 50%
tools0% | 15% | 0% | 42% | 42%
ROOT0% | 0% | 73% | 0% | 26%
ngraph_bridge/kernels0% | 0% | 59% | 34% | 6%
diagnostics/model_test0% | 0% | 68% | 17% | 14%
ngraph_bridge/pass0% | 0% | 13% | 12% | 74%
diagnostics0% | 0% | 21% | 10% | 67%
diagnostics/model_accuracy0% | 0% | 45% | 0% | 54%
python/ngraph_bridge0% | 0% | 0% | 27% | 72%
python0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
Status AssignClusters()
in ngraph_bridge/assign_clusters.cc
349 65 1
def parse_logs()
in tools/log_parser.py
77 38 2
Status Encapsulator::AnalysisPass()
in ngraph_bridge/encapsulate_clusters.cc
209 38 0
static Status TranslateFusedConv2DOp()
in ngraph_bridge/ngraph_builder.cc
164 26 3
static Status ValuesFromConstNode()
in ngraph_bridge/ngraph_builder.cc
91 23 3
Status Encapsulator::RewritePass()
in ngraph_bridge/encapsulate_clusters.cc
126 21 2
def calculate_output()
in diagnostics/model_test/verify_model.py
60 19 3
Status Builder::TranslateGraph()
in ngraph_bridge/ngraph_builder.cc
110 19 5
Status MarkForClustering()
in ngraph_bridge/mark_for_clustering.cc
110 18 2
Status TensorToStream()
in ngraph_bridge/tf_utils.cc
56 18 2
def main()
in diagnostics/remove_protobuf_class_attribute.py
41 16 0
Status TFDataTypeToNGraphElementType()
in ngraph_bridge/tf_utils.cc
54 16 2
bool Executable::Call()
in ngraph_bridge/executable.cc
69 15 2
def main()
in build_ngtf.py
286 14 0
void Transpose3D()
in ngraph_bridge/ngraph_conversions.h
17 14 1
Status CanContractEdgeDeadnessCheck()
in ngraph_bridge/assign_clusters.cc
49 14 3
bool TransposeSinking::run_on_function()
in ngraph_bridge/pass/transpose_sinking.cc
49 14 1
def version_check()
in build_ngtf.py
21 13 3
static void MaybeLogPlacement()
in ngraph_bridge/deassign_clusters.cc
74 13 1
static Status TensorDataToVector()
in ngraph_bridge/ngraph_builder.cc
50 13 2