MCPcopy Create free account
hub / github.com/DeusData/codebase-memory-mcp / evaluateRisks

Function evaluateRisks

graph-ui/src/ir/semantic-ir-builder.ts:183–201  ·  view source on GitHub ↗
(
    symbol: SymbolRef,
    callers: Fact<CallerRef[]>,
    tests: Fact<TestRef[]>
)

Source from the content-addressed store, hash-verified

181 * factory is the point of the factory.
182 */
183export function evaluateRisks(
184 symbol: SymbolRef,
185 callers: Fact<CallerRef[]>,
186 tests: Fact<TestRef[]>
187): Risk[] {
188 const risks: Risk[] = [];
189 const isHub = callers.value.length >= UNTESTED_HUB_CALLERS;
190 const untested = tests.value.length === 0 && tests.state === 'inferred';
191 if (isHub && untested) {
192 risks.push({
193 id: RISK_UNTESTED_HUB,
194 severity: 'medium',
195 kind: RISK_UNTESTED_HUB,
196 message: `${symbol.name} is called from ${countOf(callers.value.length, 'place', 'places')}`
197 + ' and no test caller was found, so a change here is unverified everywhere it is used.'
198 });
199 }
200 return risks;
201}
202
203// ---------------------------------------------------------------------------
204

Callers 1

buildIrFunction · 0.85

Calls 2

countOfFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected