microsoft / CNTK
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 9,009 units with 128,935 lines of code in units (57.6% of code).
    • 21 very complex units (8,666 lines of code)
    • 73 complex units (9,422 lines of code)
    • 407 medium complex units (25,188 lines of code)
    • 731 simple units (22,408 lines of code)
    • 7,777 very simple units (63,251 lines of code)
6% | 7% | 19% | 17% | 49%
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
cpp12% | 7% | 23% | 17% | 38%
h1% | 7% | 15% | 17% | 57%
py0% | 5% | 16% | 16% | 61%
hpp0% | 0% | 0% | 52% | 47%
cc0% | 0% | 0% | 26% | 73%
cs0% | 0% | 0% | 5% | 94%
java0% | 0% | 0% | 0% | 100%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
Source/CNTKv2LibraryDll16% | 5% | 16% | 18% | 41%
Source/Readers4% | 9% | 25% | 17% | 42%
Source/SGDLib25% | 7% | 26% | 14% | 26%
Source/ActionsLib27% | 0% | 33% | 15% | 23%
Source/CNTK21% | 21% | 16% | 12% | 27%
Source/1BitSGD13% | 10% | 21% | 20% | 33%
Source/ComputationNetworkLib1% | 7% | 18% | 19% | 52%
Source/Math0% | 8% | 17% | 16% | 57%
bindings/python0% | 5% | 16% | 16% | 61%
Source/Common0% | 2% | 12% | 14% | 70%
Source/SequenceTrainingLib0% | 8% | 37% | 26% | 27%
Scripts0% | 0% | 33% | 21% | 45%
Source/EvalDll0% | 0% | 15% | 8% | 76%
Source/PerformanceProfilerDll0% | 0% | 23% | 0% | 76%
Source/Extensibility0% | 0% | 0% | 26% | 73%
bindings/csharp0% | 0% | 0% | 5% | 94%
bindings/java0% | 0% | 0% | 0% | 100%
Tutorials/HelloWorld-LogisticRegression0% | 0% | 0% | 0% | 100%
Tutorials/NumpyInterop0% | 0% | 0% | 0% | 100%
Tutorials/ImageHandsOn0% | 0% | 0% | 0% | 100%
PretrainedModels0% | 0% | 0% | 0% | 100%
Source/DelayLoadedExtensionsDll0% | 0% | 0% | 0% | 100%
Tools0% | 0% | 0% | 0% | 100%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void PrimitiveFunction::InferOutputs()
in Source/CNTKv2LibraryDll/PrimitiveFunction.cpp
860 293 1
FunctionPtr ONNXToCNTKHelper::CreateFunction()
in Source/CNTKv2LibraryDll/proto/onnx/ONNXToCNTK.cpp
984 192 5
ComputationNodeBasePtr CompositeFunction::CreateComputationNode()
in Source/CNTKv2LibraryDll/CompositeFunction.cpp
721 159 6
void NDLNodeEvaluatorImpl::Evaluate()
in Source/ActionsLib/NDLNetworkBuilder.cpp
624 145 3
void SGD::TrainOrAdaptModel()
in Source/SGDLib/SGD.cpp
614 144 7
void CNTKToONNXHelper::CopyAttributes()
in Source/CNTKv2LibraryDll/proto/onnx/CNTKToONNX.cpp
464 127 2
void MELScript::CallFunction()
in Source/CNTK/ModelEditLanguage.cpp
453 119 2
size_t SGD::TrainOneEpoch()
in Source/SGDLib/SGD.cpp
506 112 23
bool CheckFunction()
in Source/ActionsLib/NetworkDescriptionLanguage.cpp
112 99 2
Variable ResolveFunction()
in Source/CNTKv2LibraryDll/BackCompat.cpp
392 98 2
bool HTKMLFReader::GetMinibatchToTrainOrTest()
in Source/Readers/HTKMLFReader/HTKMLFReader.cpp
410 93 1
void CNTKToONNXHelper::ProcessInputs()
in Source/CNTKv2LibraryDll/proto/onnx/CNTKToONNX.cpp
235 81 7
void ComputationNode::WriteMinibatchWithFormatting()
in Source/ComputationNetworkLib/ComputationNode.cpp
226 75 17
void AggregateGradientsImpl()
in Source/1BitSGD/AllReduceDistGradAggregator.h
254 73 3
void estimate()
in Source/Readers/Kaldi2Reader/msra_mgram.h
277 73 3
void HTKMLFReader::PrepareForTrainingOrTesting()
in Source/Readers/HTKMLFReader/HTKMLFReader.cpp
382 69 1
static ConfigValuePtr Evaluate()
in Source/CNTK/BrainScript/BrainScriptEvaluator.cpp
245 66 4
std::vector CreateRNNConstantHelper()
in Source/CNTKv2LibraryDll/proto/onnx/ONNXToCNTK.cpp
355 61 5
void DoWriteWordAndClassInfo()
in Source/ActionsLib/OtherActions.cpp
214 55 1
void read()
in Source/Readers/Kaldi2Reader/msra_mgram.h
193 55 4