microsoft / PowerBI-visuals-tools
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 107 units with 1,512 lines of code in units (77.4% of code).
    • 1 very long units (143 lines of code)
    • 2 long units (145 lines of code)
    • 19 medium size units (529 lines of code)
    • 25 small units (360 lines of code)
    • 60 very small units (335 lines of code)
9% | 9% | 34% | 23% | 22%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
js12% | 12% | 33% | 22% | 19%
ts0% | 0% | 38% | 27% | 34%
r0% | 0% | 47% | 29% | 23%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
lib14% | 14% | 34% | 20% | 16%
templates/visuals/rhtml0% | 0% | 46% | 28% | 25%
templates/visuals/table0% | 0% | 45% | 26% | 27%
templates0% | 0% | 67% | 32% | 0%
templates/visuals/rvisual0% | 0% | 53% | 0% | 46%
spec/helpers0% | 0% | 0% | 40% | 59%
templates/visuals/slicer0% | 0% | 0% | 50% | 50%
templates/visuals/default0% | 0% | 0% | 51% | 48%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
async function createCertFile()
in lib/CertificateTools.js
143 24 2
function generateSettings()
in lib/VisualGenerator.js
81 21 2
async function resolveCertificate()
in lib/CertificateTools.js
64 18 0
FlattenHTML <- function()
in templates/visuals/rhtml/r_files/flatten_HTML.r
45 7 2
static validationLog()
in lib/ConsoleWriter.js
37 13 1
static generate()
in lib/VisualGenerator.js
33 13 3
33 8 3
private injectCodeFromPayload()
in templates/visuals/rhtml/src/visual.ts
33 11 1
async function veryfyCertFile()
in lib/CertificateTools.js
31 9 4
async appendPlugins()
in lib/WebPackWrap.js
31 4 3
export function visualTransform()
in templates/visuals/table/src/visualTransform.ts
31 11 1
module.exports = function()
in templates/pbiviz-json-template.js
29 1 1
runNpmInstall()
in lib/TemplateFetcher.js
26 3 0
async function removeCertFiles()
in lib/CertificateTools.js
23 7 3
static checkVisualName()
in lib/VisualGenerator.js
23 8 1
async applyWebpackConfig()
in lib/WebPackWrap.js
23 4 9
public update()
in templates/visuals/rhtml/src/visual.ts
23 11 1
async function getCertFile()
in lib/CertificateTools.js
22 7 2
async function getGlobalPbivizCerts()
in lib/CertificateTools.js
22 9 0
public update()
in templates/visuals/rvisual/src/visual.ts
22 10 1