microsoft / near-duplicate-code-detector
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 36 units with 469 lines of code in units (61.1% of code).
    • 0 very complex units (0 lines of code)
    • 0 complex units (0 lines of code)
    • 1 medium complex units (39 lines of code)
    • 2 simple units (17 lines of code)
    • 33 very simple units (413 lines of code)
0% | 0% | 8% | 3% | 88%
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
java0% | 0% | 45% | 0% | 54%
py0% | 0% | 0% | 47% | 52%
cs0% | 0% | 0% | 0% | 100%
js0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
tokenizers/java/src/main/java/javatokenizer0% | 0% | 45% | 0% | 54%
tokenizers/python0% | 0% | 0% | 47% | 52%
DuplicateCodeDetector0% | 0% | 0% | 0% | 100%
DuplicateCodeDetector/Utils0% | 0% | 0% | 0% | 100%
tokenizers/CsharpTokenizer/CsharpTokenizer0% | 0% | 0% | 0% | 100%
tokenizers/javascript0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
public static SerializableTokens TokenizeFile()
in tokenizers/java/src/main/java/javatokenizer/Extractor.java
39 17 3
def tokenize_line()
in tokenizers/python/baronetokenizer.py
6 6 1
def tokenize_file()
in tokenizers/python/tokenizepythoncorpus.py
11 6 2
private IEnumerable FindNearDuplicates()
in DuplicateCodeDetector/CloneDetector.cs
24 5 4
public CloneGroups()
in DuplicateCodeDetector/CloneGroups.cs
32 5 1
public void BuildIndexForProject()
in DuplicateCodeDetector/CloneDetector.cs
29 4 1
private int MakeCloneSetTransitive()
in DuplicateCodeDetector/CloneGroups.cs
24 4 0
public double JaccardSimilarity()
in DuplicateCodeDetector/Utils/SparseVector.cs
19 4 1
public static void ExtractForFolder()
in tokenizers/java/src/main/java/javatokenizer/Extractor.java
30 4 4
function listAllFilesRecursive()
in tokenizers/javascript/parser.js
16 4 3
function getTokens()
in tokenizers/javascript/parser.js
10 4 2
private static IEnumerable Count()
in DuplicateCodeDetector/CloneDetector.cs
13 3 1
private IEnumerable GetAllProjectCombinations()
in DuplicateCodeDetector/CloneDetector.cs
12 3 0
public void AddElements()
in DuplicateCodeDetector/Utils/SparseVector.cs
11 3 1
public double KeyJaccardSimilarity()
in DuplicateCodeDetector/Utils/SparseVector.cs
17 3 1
function extractForFolder()
in tokenizers/javascript/parser.js
17 3 4
def tokenize_all()
in tokenizers/python/baronetokenizer.py
6 3 1
def tokenize_all_files()
in tokenizers/python/tokenizepythoncorpus.py
8 3 3
def tokenize_all_project_folders()
in tokenizers/python/tokenizepythoncorpus.py
5 3 3
private void AddDuplicate()
in DuplicateCodeDetector/CloneDetector.cs
9 2 2