facebookresearch / vizseq
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 248 units with 1,222 lines of code in units (28.3% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 3 medium complex units (112 lines of code)
    • 10 simple units (145 lines of code)
    • 235 very simple units (965 lines of code)
0% | 0% | 9% | 11% | 78%
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% | 9% | 12% | 78%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
vizseq/scorers0% | 0% | 13% | 9% | 77%
vizseq/ipynb0% | 0% | 41% | 0% | 58%
vizseq/_data0% | 0% | 8% | 23% | 68%
vizseq/_view0% | 0% | 0% | 16% | 83%
vizseq0% | 0% | 0% | 0% | 100%
vizseq/_utils0% | 0% | 0% | 0% | 100%
vizseq/_visualizers0% | 0% | 0% | 0% | 100%
website/src0% | 0% | 0% | 0% | 100%
vizseq/_aligners0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def _get_wer()
in vizseq/scorers/_wer.py
47 18 2
def _get_data()
in vizseq/ipynb/fairseq_viz.py
35 13 2
def __init__()
in vizseq/_data/data_sources.py
30 11 3
def __init__()
in vizseq/_data/data_sources.py
21 9 2
def get_scores()
in vizseq/_view/web_view.py
25 8 1
def tag_lang_pair()
in vizseq/_data/lang_tagger.py
15 8 3
def get_len()
in vizseq/_data/data_sources.py
12 8 3
def get_len()
in vizseq/_data/data_sources.py
14 8 3
def get_wer()
in vizseq/scorers/_wer.py
9 7 2
def _get_edit_distance()
in vizseq/scorers/_ter.py
15 7 2
def _get_idf()
in vizseq/scorers/_cider/__init__.py
9 6 2
def to_dict()
in vizseq/_data/stats.py
12 6 2
def tokenize_line()
in vizseq/_data/tokenizers.py
13 6 3
def visualize()
in vizseq/_visualizers/dict_visualizer.py
14 5 3
def filter()
in vizseq/_view/data_filter.py
8 5 3
def cached()
in vizseq/_data/data_sources.py
10 5 2
def cached()
in vizseq/_data/data_sources.py
16 5 2
def __init__()
in vizseq/_data/data_sources.py
10 5 4
def text()
in vizseq/_data/data_sources.py
5 5 1
def _batch()
in vizseq/scorers/__init__.py
9 4 3