Flags trivial wrappers that mostly just rename or forward another call.
- Family:
structure - Severity:
strong - Scope:
file - Requires:
file.functionSummaries,file.comments
The rule looks for functions whose body is essentially a direct pass-through call. It skips two common intentional cases:
- nearby alias / compatibility comments such as
aliasorbackward compatibility - boundary wrappers around targets like
fetch,axios.*,prisma.*,redis.*, and similar APIs
export function getUser(id: string) {
return loadUser(id);
}
export function saveUser(input: UserInput) {
return persistUser(input);
}// backward compatibility alias
export function fetchUserRecord(id: string) {
return getUser(id);
}
export function getJson(url: string) {
return fetch(url);
}A wrapper should earn its existence. Keep it only if it adds something real, such as:
- validation
- normalization
- retries or metrics
- naming a stable compatibility layer
- adapting one API shape into another
Otherwise, call the underlying function directly or merge the wrapper away.
export async function saveUser(input: UserInput) {
const normalized = normalizeUserInput(input);
return persistUser(normalized);
}The goal is to reduce indirection that makes the codebase feel larger without adding behavior or clearer boundaries.
Each wrapper adds 2 points, capped at 5 for the file.
Small pinned rule benchmark (manifest):
- Signal rank: #6 of 9
- Signal score: 0.67 / 1.00
- Best separating metric: findings / file (0.85)
- Hit rate: 5/6 AI repos vs 4/5 mature OSS repos
- Full results: rule signal report