Zum Inhalt

Compliance-Score

Pflichtfeld-Vollstaendigkeit ueber alle Dateien. Automatisch berechnet via DataviewJS.


Gesamt-Score

const pages = dv.pages('"IMS" OR "ISMSI" OR "QMS" OR "ISDS2"');
const pflichtfelder = ["title", "type", "management_system", "classification", "status"];

let total = 0;
let filled = 0;

for (const p of pages) {
  for (const f of pflichtfelder) {
    total++;
    if (p[f] && p[f] !== null && p[f] !== "") filled++;
  }
}

const score = Math.round((filled / total) * 100);
dv.paragraph(`**Compliance-Score: ${score}/100** (${filled}/${total} Pflichtfelder befuellt)`);
dv.paragraph("---");

// Score pro Space
const spaces = ["IMS", "ISMS", "QMS", "DSMS"];
const rows = [];
for (const space of spaces) {
  const sp = pages.where(p => p.management_system === space);
  let st = 0, sf = 0;
  for (const p of sp) {
    for (const f of pflichtfelder) {
      st++;
      if (p[f] && p[f] !== null && p[f] !== "") sf++;
    }
  }
  rows.push([space, sp.length, sf, st, st > 0 ? Math.round((sf/st)*100) + "%" : "—"]);
}
dv.table(["Space", "Dateien", "Befuellt", "Gesamt", "Score"], rows);

Score pro Dokumenttyp

const pages = dv.pages('"IMS" OR "ISMSI" OR "QMS" OR "ISDS2"');
const pflichtfelder = ["title", "type", "management_system", "classification", "status"];

const types = {};
for (const p of pages) {
  const t = p.type || "unbekannt";
  if (!types[t]) types[t] = { total: 0, filled: 0, count: 0 };
  types[t].count++;
  for (const f of pflichtfelder) {
    types[t].total++;
    if (p[f] && p[f] !== null && p[f] !== "") types[t].filled++;
  }
}

const rows = Object.entries(types)
  .sort((a, b) => b[1].count - a[1].count)
  .map(([type, data]) => [
    type,
    data.count,
    data.filled,
    data.total,
    Math.round((data.filled / data.total) * 100) + "%"
  ]);

dv.table(["Typ", "Dateien", "Befuellt", "Gesamt", "Score"], rows);

Änderungshistorie

Datum Autor Änderung
2026-02-15 Visitrans Execute SPEC-03: Plugins, templates, dashboards, placeholder replacement