facebookresearch / habitat-sim
Unit Size

The distribution of size of units (measured in lines of code).

Intro
  • Unit size measurements show the distribution of size of units of code (methods, functions...).
  • Units are classified in four categories based on their size (lines of code): 1-20 (small units), 20-50 (medium size units), 51-100 (long units), 101+ (very long units).
  • You should aim at keeping units small (< 20 lines). Long units may become "bloaters", code that have increased to such gargantuan proportions that they are hard to work with.
Learn more...
Unit Size Overall
  • There are 2,481 units with 30,218 lines of code in units (55.9% of code).
    • 35 very long units (5,828 lines of code)
    • 80 long units (5,309 lines of code)
    • 220 medium size units (6,594 lines of code)
    • 326 small units (4,667 lines of code)
    • 1,820 very small units (7,820 lines of code)
19% | 17% | 21% | 15% | 25%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp26% | 23% | 24% | 14% | 11%
py15% | 11% | 18% | 17% | 38%
frag22% | 15% | 32% | 19% | 10%
js0% | 15% | 29% | 26% | 28%
h0% | 1% | 13% | 16% | 69%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
src/esp18% | 18% | 21% | 15% | 25%
src/utils31% | 18% | 26% | 14% | 9%
src_python/habitat_sim12% | 5% | 19% | 17% | 45%
tools37% | 12% | 12% | 20% | 16%
src/shaders22% | 15% | 32% | 19% | 10%
ROOT0% | 46% | 24% | 8% | 20%
conda-build0% | 57% | 0% | 16% | 26%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void initAttributesBindings()
in src/esp/bindings/AttributesBindings.cpp
497 51 1
Mn::Matrix4 BulletURDFImporter::convertURDF2BulletInternal()
in src/esp/physics/bullet/BulletURDFImporter.cpp
287 36 6
void initSimBindings()
in src/esp/bindings/SimBindings.cpp
279 11 1
void PTexMeshData::parsePLY()
in src/esp/assets/PTexMeshData.cpp
224 43 2
void initPhysicsBindings()
in src/esp/bindings/PhysicsBindings.cpp
216 1 1
void declareArticulatedObjectWrapper()
in src/esp/bindings/PhysicsObjectBindings.cpp
204 1 3
void Viewer::keyPressEvent()
in src/utils/viewer/viewer.cpp
196 52 1
void initSensorBindings()
in src/esp/bindings/SensorBindings.cpp
195 3 1
void declareBaseAttributesManager()
in src/esp/bindings/AttributesManagersBindings.cpp
194 1 3
void initGfxBindings()
in src/esp/bindings/GfxBindings.cpp
179 2 1
bool PathFinder::Impl::build()
in src/esp/nav/PathFinder.cpp
175 29 7
def initialize_test_data_sources()
in src_python/habitat_sim/utils/datasets_download.py
174 13 1
void declareBasePhysicsObjectWrapper()
in src/esp/bindings/PhysicsObjectBindings.cpp
168 1 3
bool Parser::parseLink()
in src/esp/io/URDFParser.cpp
166 26 3
def main()
in tools/run-clang-tidy.py
161 24 0
void initAttributesManagersBindings()
in src/esp/bindings/AttributesManagersBindings.cpp
158 10 1
154 15 7
void initSceneBindings()
in src/esp/bindings/SceneBindings.cpp
152 1 1
void declareBaseWrapperManager()
in src/esp/bindings/PhysicsWrapperManagerBindings.cpp
146 1 3
void Viewer::mousePressEvent()
in src/utils/viewer/viewer.cpp
145 25 1