MCPcopy Create free account
hub / github.com/openai/plugins / rankActionableChecks

Function rankActionableChecks

plugins/plugin-eval/src/core/scoring.js:152–172  ·  view source on GitHub ↗
(checks)

Source from the content-addressed store, hash-verified

150}
151
152function rankActionableChecks(checks) {
153 return checks
154 .filter((check) => check.status === "fail" || check.status === "warn")
155 .map((check) => ({
156 ...check,
157 penalty: computeCheckPenalty(check),
158 why: deriveCheckWhy(check),
159 }))
160 .sort((left, right) => {
161 if (right.penalty !== left.penalty) {
162 return right.penalty - left.penalty;
163 }
164 if ((STATUS_PRIORITY[left.status] ?? 99) !== (STATUS_PRIORITY[right.status] ?? 99)) {
165 return (STATUS_PRIORITY[left.status] ?? 99) - (STATUS_PRIORITY[right.status] ?? 99);
166 }
167 if ((CATEGORY_PRIORITY[left.category] ?? 99) !== (CATEGORY_PRIORITY[right.category] ?? 99)) {
168 return (CATEGORY_PRIORITY[left.category] ?? 99) - (CATEGORY_PRIORITY[right.category] ?? 99);
169 }
170 return left.id.localeCompare(right.id);
171 });
172}
173
174function summarizeFinding(check) {
175 return {

Callers 1

enrichSummaryFunction · 0.85

Calls 4

computeCheckPenaltyFunction · 0.85
deriveCheckWhyFunction · 0.85
mapMethod · 0.80
filterMethod · 0.80

Tested by

no test coverage detected