facebookresearch / habitat-sim
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 2,481 units with 30,218 lines of code in units (55.9% of code).
    • 2 very complex units (693 lines of code)
    • 6 complex units (1,039 lines of code)
    • 65 medium complex units (5,210 lines of code)
    • 141 simple units (5,464 lines of code)
    • 2,267 very simple units (17,812 lines of code)
2% | 3% | 17% | 18% | 58%
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
cpp3% | 5% | 21% | 23% | 47%
py0% | 0% | 24% | 14% | 61%
frag0% | 0% | 38% | 16% | 45%
h0% | 0% | 1% | 3% | 95%
js0% | 0% | 0% | 11% | 88%
Conditional Complexity per Logical Component
primary logical decomposition
51+
26-50
11-25
6-10
1-5
src/esp1% | 4% | 15% | 18% | 60%
src/utils13% | 0% | 29% | 24% | 32%
src_python/habitat_sim0% | 0% | 19% | 11% | 69%
tools0% | 0% | 44% | 12% | 43%
src/shaders0% | 0% | 38% | 16% | 45%
conda-build0% | 0% | 57% | 0% | 42%
ROOT0% | 0% | 14% | 65% | 20%
Most Complex Units
Top 20 most complex units
Unit# linesMcCabe index# params
void Viewer::keyPressEvent()
in src/utils/viewer/viewer.cpp
196 52 1
void initAttributesBindings()
in src/esp/bindings/AttributesBindings.cpp
497 51 1
void PTexMeshData::parsePLY()
in src/esp/assets/PTexMeshData.cpp
224 43 2
Mn::Matrix4 BulletURDFImporter::convertURDF2BulletInternal()
in src/esp/physics/bullet/BulletURDFImporter.cpp
287 36 6
bool Parser::parseJoint()
in src/esp/io/URDFParser.cpp
120 30 2
void generateInteriorExteriorVoxelGrid()
in src/esp/geo/VoxelUtils.cpp
67 29 1
bool PathFinder::Impl::build()
in src/esp/nav/PathFinder.cpp
175 29 7
bool Parser::parseLink()
in src/esp/io/URDFParser.cpp
166 26 3
void generateManhattanDistanceSDF()
in src/esp/geo/VoxelUtils.cpp
75 25 2
void Viewer::mousePressEvent()
in src/utils/viewer/viewer.cpp
145 25 1
def main()
in tools/run-clang-tidy.py
161 24 0
void Simulator::reconfigure()
in src/esp/sim/Simulator.cpp
74 23 1
bool Parser::parseGeometry()
in src/esp/io/URDFParser.cpp
88 22 2
void Viewer::drawEvent()
in src/utils/viewer/viewer.cpp
125 21 0
bool Parser::parseURDF()
in src/esp/io/URDFParser.cpp
112 19 2
bool SemanticScene::buildMp3dHouse()
in src/esp/scene/Mp3dSemanticScene.cpp
143 19 3
bool ResourceManager::loadStage()
in src/esp/assets/ResourceManager.cpp
120 19 5
std::vector splitMesh()
in src/esp/assets/PTexMeshData.cpp
102 18 2
void PbrDrawable::draw()
in src/esp/gfx/PbrDrawable.cpp
80 18 2
StageAttributes::ptr StageAttributesManager::initNewObjectInternal()
in src/esp/metadata/managers/StageAttributesManager.cpp
109 18 2