microsoft / WinObjC
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 18,071 units with 183,965 lines of code in units (31.5% of code).
    • 123 very long units (21,686 lines of code)
    • 367 long units (25,343 lines of code)
    • 1,155 medium size units (36,597 lines of code)
    • 1,770 small units (25,783 lines of code)
    • 14,656 very small units (74,556 lines of code)
11% | 13% | 19% | 14% | 40%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
c20% | 22% | 29% | 15% | 12%
cpp13% | 18% | 24% | 18% | 23%
mm11% | 11% | 20% | 16% | 40%
h<1% | 1% | 2% | 5% | 88%
cs3% | 17% | 31% | 26% | 21%
m0% | 15% | 32% | 30% | 21%
hpp0% | 0% | 38% | 38% | 22%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
Frameworks/CoreFoundation19% | 21% | 29% | 16% | 13%
tools/winmd2objc22% | 19% | 25% | 16% | 15%
Frameworks/AudioToolbox24% | 14% | 26% | 12% | 22%
Frameworks/OpenGLES25% | 6% | 10% | 8% | 48%
Frameworks/ImageIO62% | 7% | 22% | 1% | 6%
Frameworks/Accelerate26% | 26% | 4% | 6% | 36%
tools/objc2winmd14% | 27% | 25% | 19% | 13%
Frameworks/AddressBook54% | 0% | 5% | 9% | 30%
Frameworks/Starboard22% | 3% | 29% | 16% | 27%
tools/vsimporter5% | 17% | 25% | 22% | 29%
Frameworks/UIKit6% | 27% | 25% | 15% | 24%
Frameworks/Foundation6% | 13% | 30% | 22% | 27%
Frameworks/CoreGraphics2% | 6% | 19% | 22% | 48%
tools/ClangCompileTask15% | 36% | 19% | 21% | 8%
tools/include13% | 15% | 39% | 3% | 28%
tools/Logging9% | 12% | 20% | 8% | 48%
include/Metal26% | 14% | 11% | 4% | 43%
tools/AppInsights0% | 19% | 35% | 14% | 30%
tools/xib2xaml0% | 12% | 34% | 25% | 27%
Frameworks/CoreText0% | 12% | 28% | 21% | 37%
Frameworks/RTObjCInterop0% | 16% | 40% | 34% | 8%
include/HomeKit0% | 68% | 0% | 9% | 22%
include/CFNetwork0% | 76% | 0% | 0% | 23%
Frameworks/GLKit0% | 4% | 22% | 37% | 36%
Frameworks/include0% | 2% | 22% | 29% | 44%
tools/AssetCatalogBuilder0% | 30% | 19% | 37% | 12%
Frameworks/UIKit.Xaml0% | 0% | 15% | 20% | 64%
Frameworks/QuartzCore0% | 0% | 24% | 40% | 34%
Frameworks/CoreFoundationAdditions0% | 0% | 65% | 8% | 26%
tools/BuildMonitor0% | 0% | 40% | 55% | 3%
Frameworks/MobileCoreServices0% | 0% | 38% | 28% | 33%
include/Platform0% | 0% | 3% | 29% | 67%
Frameworks/CoreData0% | 0% | 63% | 0% | 36%
Frameworks/Security0% | 0% | 9% | 11% | 78%
Frameworks/CoreLocation0% | 0% | 35% | 41% | 22%
include/AudioToolbox0% | 0% | 75% | 0% | 25%
include/CoreGraphics0% | 0% | 12% | 0% | 87%
include/GameKit0% | 0% | 82% | 0% | 17%
tools/WinObjC.Compiler0% | 0% | <1% | 2% | 97%
include/Foundation0% | 0% | 13% | 13% | 72%
tools/PropSchemaGen0% | 0% | 81% | 0% | 18%
include/UIKit0% | 0% | 16% | 9% | 73%
Frameworks/CoreMedia0% | 0% | 0% | 10% | 89%
tools/WOCStdLib0% | 0% | 0% | 46% | 53%
Frameworks/CoreVideo0% | 0% | 0% | 18% | 81%
Frameworks/Social.Xaml0% | 0% | 0% | 52% | 47%
include/Accounts0% | 0% | 0% | 78% | 21%
include/CoreData0% | 0% | 0% | 22% | 77%
include/Contacts0% | 0% | 0% | 41% | 58%
include/MediaPlayer0% | 0% | 0% | 14% | 85%
Frameworks/SafariServices0% | 0% | 0% | 100% | 0%
include/GLKit0% | 0% | 0% | 0% | 100%
Frameworks/CFNetwork0% | 0% | 0% | 0% | 100%
Frameworks/CoreMIDI0% | 0% | 0% | 0% | 100%
Frameworks/MapKit0% | 0% | 0% | 0% | 100%
Frameworks/AudioUnit0% | 0% | 0% | 0% | 100%
Frameworks/MediaAccessibility0% | 0% | 0% | 0% | 100%
Frameworks/SystemConfiguration0% | 0% | 0% | 0% | 100%
include/Accelerate0% | 0% | 0% | 0% | 100%
Frameworks/CoreAudio0% | 0% | 0% | 0% | 100%
Frameworks/Metal0% | 0% | 0% | 0% | 100%
tools/WinObjC.Tools0% | 0% | 0% | 0% | 100%
include/AVFoundation0% | 0% | 0% | 0% | 100%
include/WebKit0% | 0% | 0% | 0% | 100%
include/iAd0% | 0% | 0% | 0% | 100%
Frameworks/AutoLayout0% | 0% | 0% | 0% | 100%
include/AddressBook0% | 0% | 0% | 0% | 100%
tools/include_next0% | 0% | 0% | 0% | 100%
Frameworks/MediaPlayer0% | 0% | 0% | 0% | 100%
include/CoreLocation0% | 0% | 0% | 0% | 100%
include/LocalAuthentication0% | 0% | 0% | 0% | 100%
build/RTObjCInterop0% | 0% | 0% | 0% | 100%
Frameworks/GameController0% | 0% | 0% | 0% | 100%
include/CoreMIDI0% | 0% | 0% | 0% | 100%
tools/WinObjC.Language0% | 0% | 0% | 0% | 100%
include/Social0% | 0% | 0% | 0% | 100%
include/AssetsLibrary0% | 0% | 0% | 0% | 100%
include/AudioUnit0% | 0% | 0% | 0% | 100%
Frameworks/AVFoundation0% | 0% | 0% | 0% | 100%
Frameworks/CoreMotion0% | 0% | 0% | 0% | 100%
include/CoreVideo0% | 0% | 0% | 0% | 100%
include/MessageUI0% | 0% | 0% | 0% | 100%
Frameworks/AssetsLibrary0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
void OpenGLESState::init()
in Frameworks/OpenGLES/GLES1122/OpenGLES20/OpenGLESState.mm
792 163 1
vImage_Error vImageBoxConvolve_ARGB8888()
in Frameworks/Accelerate/vImage.cpp
695 230 9
static void __CFStringAppendFormatCore()
in Frameworks/CoreFoundation/String.subproj/CFString.c
525 215 2
static int start_decoder()
in Frameworks/AudioToolbox/stb_vorbis.c
481 161 1
CF_PRIVATE bool __CFBinaryPlistCreateObjectFiltered()
in Frameworks/CoreFoundation/Parsing.subproj/CFBinaryPList.c
469 200 11
GLuint ShaderProgram::createProgram()
in Frameworks/OpenGLES/GLES1122/OpenGLES20/ShaderProgram.mm
414 153 2
Boolean CFStringFindWithOptionsAndLocale()
in Frameworks/CoreFoundation/String.subproj/CFString.c
340 209 6
CFDictionaryRef readTIFFProperties()
in Frameworks/ImageIO/CGImageSource.mm
330 134 1
CFDictionaryRef readJPEGProperties()
in Frameworks/ImageIO/CGImageSource.mm
322 123 1
Boolean __CFStringDecodeByteStream3()
in Frameworks/CoreFoundation/String.subproj/CFStringEncodings.c
321 152 7
bool ABRecordSetValue()
in Frameworks/AddressBook/ABRecord.mm
309 70 4
CFComparisonResult CFStringCompareWithOptionsAndLocale()
in Frameworks/CoreFoundation/String.subproj/CFString.c
291 205 5
int _doprnt()
in Frameworks/Foundation/FormatPrintf.mm
290 114 3
static void _CFRelease()
in Frameworks/CoreFoundation/Base.subproj/CFRuntime.c
273 79 1
void CFStringNormalize()
in Frameworks/CoreFoundation/String.subproj/CFString.c
263 92 2
CFIndex __CFStringEncodeByteStream()
in Frameworks/CoreFoundation/String.subproj/CFStringEncodings.c
263 115 9
static Boolean __CFCharacterSetEqual()
in Frameworks/CoreFoundation/String.subproj/CFCharacterSet.c
257 152 2
static int32_t __CFRunLoopRun()
in Frameworks/CoreFoundation/RunLoop.subproj/CFRunLoop.c
254 80 5
void generateVCXProj()
in tools/winmd2objc/lib/CodeGen.cpp
244 3 7
CF_PRIVATE CFMutableArrayRef _CFCreateContentsOfDirectory()
in Frameworks/CoreFoundation/Base.subproj/CFFileUtilities.c
231 80 5