google / filament
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 6,919 units with 64,475 lines of code in units (9.4% of code).
    • 67 very long units (11,386 lines of code)
    • 128 long units (8,681 lines of code)
    • 458 medium size units (14,286 lines of code)
    • 725 small units (10,547 lines of code)
    • 5,541 very small units (19,575 lines of code)
17% | 13% | 22% | 16% | 30%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
cpp24% | 16% | 25% | 15% | 18%
mm15% | 12% | 28% | 19% | 24%
h2% | 7% | 10% | 18% | 59%
py16% | 23% | 26% | 24% | 9%
js0% | 10% | 30% | 27% | 31%
kt0% | 18% | 8% | 33% | 39%
java0% | 1% | 7% | 8% | 82%
groovy0% | 0% | 69% | 14% | 15%
ts0% | 0% | 0% | 100% | 0%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
filament/src19% | 13% | 16% | 12% | 38%
filament/backend16% | 12% | 27% | 19% | 24%
libs/gltfio32% | 18% | 28% | 9% | 11%
libs/bluevk81% | 6% | 4% | 2% | 4%
libs/filamentapp43% | 10% | 25% | 7% | 12%
libs/viewer24% | 13% | 37% | 11% | 13%
tools/cmgen45% | 25% | 14% | 2% | 12%
libs/imageio26% | 32% | 21% | 12% | 6%
libs/filamat11% | 20% | 29% | 19% | 19%
libs/matdbg17% | 7% | 37% | 23% | 14%
tools/matc13% | 17% | 20% | 26% | 21%
libs/ibl15% | 12% | 38% | 17% | 16%
tools/mipgen64% | 30% | 0% | 0% | 5%
tools/resgen73% | 19% | 0% | 0% | 7%
tools/roughness-prefilter45% | 21% | 19% | 9% | 4%
libs/filameshio69% | 0% | 0% | 9% | 21%
tools/filamesh29% | 36% | 25% | 2% | 5%
libs/utils3% | 3% | 9% | 26% | 56%
tools/matinfo26% | 38% | 22% | 0% | 12%
libs/geometry55% | 0% | 0% | 24% | 20%
libs/filagui0% | 59% | 19% | 8% | 12%
libs/image0% | 14% | 26% | 43% | 15%
tools/cso-lut0% | 52% | 27% | 13% | 6%
web/filament-js0% | 12% | 25% | 29% | 32%
tools/zbloat0% | 25% | 38% | 21% | 14%
libs/filabridge0% | 19% | 14% | 26% | 39%
tools/normal-blending0% | 36% | 49% | 8% | 5%
android/filament-utils-android0% | 8% | 15% | 22% | 53%
android/filament-android0% | 1% | 7% | 8% | 82%
libs/filaflat0% | 15% | 20% | 38% | 26%
libs/math0% | 3% | 17% | 15% | 63%
libs/camutils0% | 0% | 37% | 42% | 19%
tools/specular-color0% | 0% | 63% | 15% | 20%
android/buildSrc0% | 0% | 69% | 14% | 15%
android/gltfio-android0% | 0% | 38% | 11% | 50%
tools/rgb-to-lmsr0% | 0% | 90% | 0% | 9%
tools/glslminifier0% | 0% | 72% | 12% | 15%
libs/bluegl0% | 0% | 14% | 58% | 27%
filament/include0% | 0% | 0% | 18% | 81%
android/common0% | 0% | 0% | 46% | 53%
android/filamat-android0% | 0% | 0% | 7% | 92%
build/common0% | 0% | 0% | 73% | 26%
libs/iblprefilter0% | 0% | 0% | 0% | 100%
filament/benchmark0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
static void loadDeviceFunctions()
in libs/bluevk/src/BlueVK.cpp
572 17 2
void SimpleViewer::updateUserInterface()
in libs/viewer/src/SimpleViewer.cpp
381 61 0
FrameGraphId PostProcessManager::dof()
in filament/src/PostProcessManager.cpp
349 17 6
void FRenderer::renderJob()
in filament/src/Renderer.cpp
325 62 2
321 236 3
FrameGraphId PostProcessManager::bloomPass()
in filament/src/PostProcessManager.cpp
304 22 5
void FilamentApp::run()
in libs/filamentapp/src/FilamentApp.cpp
298 72 8
CompressedTexture astcCompress()
in libs/imageio/src/BlockCompression.cpp
245 74 2
static int handleCommandLineArgments()
in tools/cmgen/src/cmgen.cpp
223 57 2
std::string shaderFromKey()
in libs/gltfio/src/MaterialGenerator.cpp
210 43 1
int main()
in tools/mipgen/src/main.cpp
208 47 2
bool FAssetLoader::createPrimitive()
in libs/gltfio/src/AssetLoader.cpp
206 45 5
void MetalDriver::draw()
in filament/backend/src/metal/MetalDriver.mm
200 26 2
static void loadInstanceFunctions()
in libs/bluevk/src/BlueVK.cpp
188 4 2
int main()
in tools/resgen/src/main.cpp
188 32 2
bool handleGet()
in libs/matdbg/src/DebugServer.cpp
187 41 2
int main()
in tools/cmgen/src/cmgen.cpp
186 47 2
bool DDSEncoder::encode()
in libs/imageio/src/ImageEncoder.cpp
183 39 1
void OpenGLDriver::framebufferTexture()
in filament/backend/src/opengl/OpenGLDriver.cpp
180 67 3
178 20 4