facebookresearch / StarSpace
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 163 units with 2,645 lines of code in units (52.0% of code).
    • 1 very complex units (176 lines of code)
    • 1 complex units (161 lines of code)
    • 9 medium complex units (542 lines of code)
    • 16 simple units (572 lines of code)
    • 136 very simple units (1,194 lines of code)
6% | 6% | 20% | 21% | 45%
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
cpp7% | 6% | 23% | 23% | 39%
h0% | 0% | 0% | 11% | 88%
cc0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/utils38% | 0% | 0% | 13% | 48%
src0% | 7% | 26% | 21% | 44%
src/apps0% | 0% | 0% | 52% | 47%
python0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void Args::parseArgs()
in src/utils/args.cpp
176 74 2
Real EmbedModel::train()
in src/model.cpp
161 27 7
94 14 5
73 13 2
47 12 4
49 11 2
52 11 2
void StarSpace::evaluate()
in src/starspace.cpp
63 11 0
84 11 5
40 11 4
bool DataParser::parse()
in src/parser.cpp
40 11 2
void normalize_text()
in src/utils/normalize.cpp
23 10 1
67 10 8
bool LayerDataParser::parse()
in src/doc_parser.cpp
38 9 3
void StarSpace::train()
in src/starspace.cpp
44 9 0
int main()
in src/apps/query_predict.cpp
40 8 2
51 7 2
void foreach_line()
in src/utils/utils.h
38 7 3
51 7 2
void StarSpace::loadBaseDocs()
in src/starspace.cpp
36 7 0