microsoft / tensorwatch
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 673 units with 5,893 lines of code in units (89.4% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 33 medium complex units (1,126 lines of code)
    • 83 simple units (1,399 lines of code)
    • 557 very simple units (3,368 lines of code)
0% | 0% | 19% | 23% | 57%
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% | 19% | 23% | 57%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tensorwatch/model_graph/hiddenlayer0% | 0% | 25% | 28% | 46%
tensorwatch0% | 0% | 11% | 22% | 65%
tensorwatch/saliency0% | 0% | 28% | 7% | 63%
tensorwatch/mpl0% | 0% | 43% | 25% | 31%
tensorwatch/plotly0% | 0% | 23% | 36% | 39%
tensorwatch/saliency/lime0% | 0% | 10% | 43% | 46%
tensorwatch/model_graph/torchstat0% | 0% | 0% | 17% | 82%
tensorwatch/model_graph0% | 0% | 0% | 47% | 52%
tensorwatch/embeddings0% | 0% | 0% | 30% | 70%
tensorwatch/receptive_field0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def topk()
in tensorwatch/evaler_utils.py
27 24 7
def conv_nd_inverse()
in tensorwatch/saliency/inverter_util.py
78 24 3
def _show_stream_items()
in tensorwatch/plotly/line_plot.py
61 22 3
def _show_stream_items()
in tensorwatch/mpl/line_plot.py
62 21 3
def linear_inverse()
in tensorwatch/saliency/inverter_util.py
58 21 3
def import_graph()
in tensorwatch/model_graph/hiddenlayer/pytorch_builder.py
32 19 5
def layers_topological_order()
in tensorwatch/model_graph/hiddenlayer/summary_graph.py
30 19 2
def _show_stream_items()
in tensorwatch/mpl/bar_plot.py
41 19 3
def import_node()
in tensorwatch/model_graph/hiddenlayer/tf_builder.py
29 18 3
def init_stream_plot()
in tensorwatch/mpl/line_plot.py
42 17 11
def import_graph()
in tensorwatch/model_graph/hiddenlayer/pytorch_builder_trace.py
9 16 5
def predecessors_f()
in tensorwatch/model_graph/hiddenlayer/summary_graph.py
27 16 6
def successors_f()
in tensorwatch/model_graph/hiddenlayer/summary_graph.py
27 16 6
def _show_stream_items()
in tensorwatch/mpl/image_plot.py
45 16 3
def _create_stream_by_string()
in tensorwatch/stream_factory.py
35 16 3
def create_stream()
in tensorwatch/watcher_base.py
32 16 7
def to_imshow_array()
in tensorwatch/image_utils.py
24 15 3
def match()
in tensorwatch/model_graph/hiddenlayer/ge.py
34 15 3
def build_dot()
in tensorwatch/model_graph/hiddenlayer/graph.py
47 14 2
def innvestigate()
in tensorwatch/saliency/epsilon_lrp.py
41 14 3