microsoft / vscode-dev-containers
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 135 units with 2,224 lines of code in units (73.8% of code).
    • 1 very long units (105 lines of code)
    • 4 long units (268 lines of code)
    • 31 medium size units (951 lines of code)
    • 42 small units (601 lines of code)
    • 57 very small units (299 lines of code)
4% | 12% | 42% | 27% | 13%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js5% | 13% | 43% | 27% | 10%
cpp0% | 0% | 88% | 0% | 11%
cs0% | 0% | 40% | 28% | 30%
go0% | 0% | 74% | 0% | 25%
ts0% | 0% | 0% | 90% | 10%
cc0% | 0% | 0% | 73% | 26%
java0% | 0% | 0% | 0% | 100%
rs0% | 0% | 0% | 0% | 100%
rb0% | 0% | 0% | 0% | 100%
swift0% | 0% | 0% | 0% | 100%
php0% | 0% | 0% | 0% | 100%
R0% | 0% | 0% | 0% | 100%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
build/src5% | 13% | 43% | 27% | 10%
containers/cpp-mariadb0% | 0% | 100% | 0% | 0%
containers/dotnet-mssql0% | 0% | 100% | 0% | 0%
containers/go-postgres0% | 0% | 82% | 0% | 17%
containers/dapr-javascript-node0% | 0% | 0% | 90% | 10%
containers/dapr-dotnet0% | 0% | 0% | 32% | 67%
containers/bazel0% | 0% | 0% | 73% | 26%
containers/dotnet0% | 0% | 0% | 100% | 0%
containers/cpp0% | 0% | 0% | 0% | 100%
containers/java-80% | 0% | 0% | 0% | 100%
containers/java-postgres0% | 0% | 0% | 0% | 100%
containers/java0% | 0% | 0% | 0% | 100%
containers/ruby0% | 0% | 0% | 0% | 100%
containers/rust-postgres0% | 0% | 0% | 0% | 100%
containers/rust0% | 0% | 0% | 0% | 100%
containers/swift0% | 0% | 0% | 0% | 100%
containers/go0% | 0% | 0% | 0% | 100%
containers/php0% | 0% | 0% | 0% | 100%
containers/r0% | 0% | 0% | 0% | 100%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
async function pushImage()
in build/src/push.js
105 35 11
function getSortedDefinitionBuildList()
in build/src/utils/config.js
83 26 3
async function loadConfig()
in build/src/utils/config.js
65 11 1
async function getLinuxPackageInfo()
in build/src/utils/image-content-extractor.js
63 14 3
function getTagList()
in build/src/utils/config.js
57 19 6
50 11 10
47 6 9
spawn: async()
in build/src/utils/async.js
46 10 3
45 15 13
async function patchImage()
in build/src/patch.js
44 8 5
async function package()
in build/src/package.js
41 11 11
int main()
in containers/cpp-mariadb/test-project/main.cpp
39 3 0
function getTagsForVersion()
in build/src/utils/config.js
35 14 5
async function getNpmGlobalPackageInfo()
in build/src/utils/image-content-extractor.js
33 11 2
async function getOtherComponentInfo()
in build/src/utils/image-content-extractor.js
33 8 3
async function getGoPackageInfo()
in build/src/utils/image-content-extractor.js
33 8 2
public static void Main()
in containers/dotnet-mssql/test-project/Program.cs
33 3 1
async function getGitRepositoryInfo()
in build/src/utils/image-content-extractor.js
29 10 2
async function getCargoPackageInfo()
in build/src/utils/image-content-extractor.js
29 8 2
async function push()
in build/src/push.js
28 11 14