firebase / oss-bot
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 151 units with 1,976 lines of code in units (37.8% of code).
    • 1 very long units (114 lines of code)
    • 5 long units (366 lines of code)
    • 14 medium size units (438 lines of code)
    • 34 small units (504 lines of code)
    • 97 very small units (554 lines of code)
5% | 18% | 22% | 25% | 28%
Legend:
101+
51-100
21-50
11-20
1-10
Unit Size per Extension
101+
51-100
21-50
11-20
1-10
ts6% | 21% | 23% | 24% | 24%
js0% | 0% | 11% | 32% | 56%
Unit Size per Logical Component
primary logical decomposition
101+
51-100
21-50
11-20
1-10
functions/src7% | 19% | 25% | 22% | 25%
functions/src/scripts0% | 100% | 0% | 0% | 0%
public0% | 0% | 11% | 32% | 56%
functions/src/shared0% | 0% | 0% | 77% | 22%
Alternative Visuals
Longest Units
Top 20 longest units
Unit# linesMcCabe index# params
async handleStaleIssue()
in functions/src/cron.ts
114 22 4
async onCommentCreated()
in functions/src/issues.ts
96 16 3
async checkMatchesTemplate()
in functions/src/issues.ts
82 12 3
export async function MakeRepoReport()
in functions/src/report.ts
75 7 2
async function deployConfig()
in functions/src/scripts/deploy-config.ts
61 7 2
async checkNewIssueTemplate()
in functions/src/issues.ts
52 8 2
50 14 5
async onNewIssue()
in functions/src/issues.ts
49 9 2
export async function GetWeeklyReport()
in functions/src/report.ts
46 2 1
export async function GetWeeklyEmail()
in functions/src/report.ts
41 4 1
async handleClosedIssue()
in functions/src/cron.ts
31 5 4
async handleIssueEvent()
in functions/src/issues.ts
28 9 5
async handleClosedIssues()
in functions/src/cron.ts
28 6 3
27 1 2
async handlePullRequestEvent()
in functions/src/pullrequests.ts
27 11 5
async function paginate()
in functions/src/github.ts
24 2 2
function GetTotalSamScore()
in functions/src/report.ts
23 5 1
async processIssues()
in functions/src/cron.ts
22 2 3
async handleIssueCommentEvent()
in functions/src/issues.ts
21 4 6
function CountIssuesWithFilter()
in functions/src/report.ts
21 4 2