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

Function countHooksInConfig

scripts/dashboard.js:666–679  ·  view source on GitHub ↗
(config)

Source from the content-addressed store, hash-verified

664
665function countHooksInConfig(config) {
666 if (!config || typeof config !== 'object') return 0;
667 if (Array.isArray(config.hooks)) return config.hooks.length;
668 if (!config.hooks || typeof config.hooks !== 'object') return 0;
669
670 let total = 0;
671 for (const value of Object.values(config.hooks)) {
672 if (!Array.isArray(value)) continue;
673 for (const matcher of value) {
674 total += Array.isArray(matcher.hooks) ? matcher.hooks.length : 1;
675 }
676 }
677 return total;
678}
679
680function readHealth(projectRoot) {
681 const today = new Date().toISOString().slice(0, 10);
682 const auditPath = path.join(projectRoot, '.planning', 'telemetry', 'audit.jsonl');

Callers 1

readHealthFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected