MCPcopy Create free account
hub / github.com/SethGammon/Citadel / orderReports

Function orderReports

scripts/stack-plan.js:149–160  ·  view source on GitHub ↗
(projectRoot, reports, options = {})

Source from the content-addressed store, hash-verified

147}
148
149function orderReports(projectRoot, reports, options = {}) {
150 const isAncestor = options.isAncestor || ((ancestor, descendant) => defaultIsAncestor(projectRoot, ancestor, descendant));
151 return [...reports].sort((left, right) => {
152 if (left.head && right.head) {
153 if (isAncestor(left.head, right.head)) return -1;
154 if (isAncestor(right.head, left.head)) return 1;
155 }
156 const generated = String(left.generatedAt || '').localeCompare(String(right.generatedAt || ''));
157 if (generated !== 0) return generated;
158 return String(left.branch || '').localeCompare(String(right.branch || ''));
159 });
160}
161
162function blockerReasons(report) {
163 const reasons = [];

Callers 1

assessStackFunction · 0.85

Calls 1

defaultIsAncestorFunction · 0.85

Tested by

no test coverage detected