amazon-research / sentence-representations
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 162 units with 2,151 lines of code in units (84.9% of code).
    • 0 very complex units (0 lines of code)
    • 1 complex units (65 lines of code)
    • 2 medium complex units (77 lines of code)
    • 19 simple units (666 lines of code)
    • 140 very simple units (1,343 lines of code)
0% | 3% | 3% | 30% | 62%
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% | 3% | 30% | 62%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
DownstreamEval/SentEval/senteval0% | 4% | 4% | 39% | 51%
PairSupCon0% | 0% | 0% | 14% | 85%
DownstreamEval/clustering0% | 0% | 0% | 8% | 91%
PairSupCon/utils0% | 0% | 0% | 0% | 100%
PairSupCon/models0% | 0% | 0% | 0% | 100%
DownstreamEval/configs0% | 0% | 0% | 0% | 100%
DownstreamEval/stseval0% | 0% | 0% | 0% | 100%
PairSupCon/dataloader0% | 0% | 0% | 0% | 100%
DownstreamEval0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
def eval()
in DownstreamEval/SentEval/senteval/engine.py
65 31 2
def get_optimizer()
in DownstreamEval/SentEval/senteval/utils.py
37 13 1
def run()
in DownstreamEval/SentEval/senteval/tools/validation.py
40 12 1
def __init__()
in DownstreamEval/SentEval/senteval/engine.py
20 10 4
def run()
in DownstreamEval/SentEval/senteval/sick.py
50 9 3
def run()
in DownstreamEval/SentEval/senteval/tools/validation.py
46 9 1
def run()
in DownstreamEval/SentEval/senteval/tools/validation.py
44 9 1
def run()
in DownstreamEval/SentEval/senteval/tools/ranking.py
73 9 1
def __init__()
in DownstreamEval/SentEval/senteval/tools/classifier.py
27 9 8
def run()
in DownstreamEval/SentEval/senteval/snli.py
39 9 3
def run()
in DownstreamEval/SentEval/senteval/sts.py
48 9 3
def train()
in PairSupCon/training.py
23 9 1
def run()
in DownstreamEval/SentEval/senteval/tools/relatedness.py
25 8 1
def show()
in DownstreamEval/clustering/metric.py
16 7 4
def run()
in DownstreamEval/SentEval/senteval/sick.py
44 7 3
def run()
in DownstreamEval/SentEval/senteval/mrpc.py
41 7 3
def trainepoch()
in DownstreamEval/SentEval/senteval/tools/ranking.py
39 7 6
def run()
in DownstreamEval/SentEval/senteval/trec.py
36 7 3
def loadFile()
in DownstreamEval/SentEval/senteval/sts.py
20 7 2
def i2t()
in DownstreamEval/SentEval/senteval/tools/ranking.py
31 6 3