tensorflow / nmt
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 142 units with 3,094 lines of code in units (88.6% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (111 lines of code)
    • 11 medium complex units (661 lines of code)
    • 21 simple units (665 lines of code)
    • 109 very simple units (1,657 lines of code)
0% | 3% | 21% | 21% | 53%
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% | 3% | 21% | 21% | 53%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
nmt0% | 4% | 24% | 18% | 52%
nmt/utils0% | 0% | 11% | 27% | 60%
nmt/scripts0% | 0% | 24% | 31% | 44%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
111 27 1
def _build_decoder()
in nmt/model.py
98 20 4
def run_main()
in nmt/nmt.py
54 17 5
def train()
in nmt/train.py
142 15 3
57 15 14
def avg_checkpoints()
in nmt/model_helper.py
54 15 4
44 14 4
def compute_bleu()
in nmt/scripts/bleu.py
44 13 4
def decode_and_evaluate()
in nmt/utils/nmt_utils.py
54 12 12
def _build_decoder_cell()
in nmt/gnmt_model.py
64 11 5
def check_vocab()
in nmt/utils/vocab_utils.py
26 11 6
24 11 3
def _single_cell()
in nmt/model_helper.py
37 10 8
def build_graph()
in nmt/model.py
25 9 3
def get_iterator()
in nmt/utils/iterator_utils.py
115 9 18
def _build_encoder()
in nmt/gnmt_model.py
35 8 2
def _external_eval()
in nmt/train.py
40 8 11
46 8 4
def _build_decoder_cell()
in nmt/attention_model.py
55 8 5
def multi_worker_inference()
in nmt/inference.py
53 7 8