MCPcopy Create free account
hub / github.com/sourcebot-dev/sourcebot / scaledCount

Function scaledCount

packages/db/tools/scripts/inject-audit-data-v2.ts:138–144  ·  view source on GitHub ↗
(baseMin: number, baseMax: number, weight: number, isWeekend: boolean)

Source from the content-addressed store, hash-verified

136 }
137
138 function scaledCount(baseMin: number, baseMax: number, weight: number, isWeekend: boolean): number {
139 const weekendFactor = isWeekend ? 0.3 : 1.0;
140 const scaledMax = Math.round(baseMax * weight * weekendFactor);
141 const scaledMin = Math.min(Math.round(baseMin * weight * weekendFactor), scaledMax);
142 if (scaledMax <= 0) return 0;
143 return scaledMin + Math.floor(Math.random() * (scaledMax - scaledMin + 1));
144 }
145
146 async function createAudits(
147 userId: string,

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected