diff --git a/.github/workflows/module-health.yml b/.github/workflows/module-health.yml new file mode 100644 index 000000000..f4396dccd --- /dev/null +++ b/.github/workflows/module-health.yml @@ -0,0 +1,44 @@ +name: Module Health + +on: + schedule: + # Mondays 06:00 UTC + - cron: '0 6 * * 1' + workflow_dispatch: + +permissions: + contents: write + +jobs: + audit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - uses: actions/setup-node@v4 + with: + node-version: '20' + + - name: Run audits + run: | + node scripts/audit-modules.mjs + node scripts/audit-module-coupling.mjs + node scripts/audit-complexity.mjs || true + node scripts/build-complexity-map.mjs + + - name: Commit reports if changed + run: | + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + PATHS="docs/module-health.md docs/module-coupling.md docs/complexity-hotspots.md docs/complexity-map.html apps/mana/apps/web/static/admin/complexity-map.html" + if git diff --quiet $PATHS 2>/dev/null; then + echo "No changes to reports." + exit 0 + fi + git add $PATHS 2>/dev/null || true + git commit -m "chore(audit): weekly module health report + + Co-Authored-By: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" + git push diff --git a/apps/mana/apps/web/src/lib/modules/complexity/ListView.svelte b/apps/mana/apps/web/src/lib/modules/complexity/ListView.svelte new file mode 100644 index 000000000..e6da8a26b --- /dev/null +++ b/apps/mana/apps/web/src/lib/modules/complexity/ListView.svelte @@ -0,0 +1,66 @@ + + + +{#if !isAdmin} +
+ Die Complexity Map ist ein internes Diagnose-Tool und nur für Admin-Nutzer sichtbar. +
++ Area = LOC · color = git churn (6 months) · hover for details +
+Map nicht generiert.
+
+ Im Repo-Root pnpm audit:map ausführen.
+
+ Interactive treemap of the entire codebase. Area = lines of code, color = git change + frequency (last 6 months). +
+Map not yet generated.
+
+ Run pnpm audit:map from the repo root. It
+ writes to
+ static/admin/complexity-map.html.
+
docs/module-health.md — per-module LOC × churn scoredocs/module-coupling.md — inter-module imports (fan-in / fan-out)docs/complexity-hotspots.md — top functions by cognitive complexity
+ All reports regenerate automatically every Monday 06:00 UTC via the
+ module-health GitHub Action.
+