diff --git a/.github/scripts/depth_conditional_nesting_GP.py b/.github/scripts/depth_conditional_nesting_GP.py index d76f147..202727e 100644 --- a/.github/scripts/depth_conditional_nesting_GP.py +++ b/.github/scripts/depth_conditional_nesting_GP.py @@ -85,10 +85,10 @@ def visit_If(self, node: ast.If) -> None: def get_status_code(max_depth: int) -> str: if max_depth > CRITICAL_THRESHOLD: - return "❌ CRITICAL" + return "CRITICAL" if max_depth >= WARNING_THRESHOLD: - return "🚨 WARNING" - return "✅ OK" + return "WARNING" + return "OK" def get_metrics(filepath: Path) -> Optional[Dict[str, Any]]: @@ -144,7 +144,7 @@ def main() -> None: all_results.append({ "file": str(filepath), "avg_depth": metrics["avg"], - "max_depth": metrics["max"], + "max_nesting_depth": metrics["max"], "status_code": metrics["status_code"] }) if metrics["max"] > CRITICAL_THRESHOLD: diff --git a/.github/scripts/fog_comments_indexGP.py b/.github/scripts/fog_comments_indexGP.py index fcd9358..0c4cf57 100644 --- a/.github/scripts/fog_comments_indexGP.py +++ b/.github/scripts/fog_comments_indexGP.py @@ -1,12 +1,10 @@ -import re -import os -import sys -import json -import textstat +import re, os, sys, json, textstat from pathlib import Path SUPPORTED_EXTENSIONS = {'.py', '.js', '.ts', '.cpp', '.java', '.html'} +EXCLUDE_DIRS = {'.git', 'node_modules', 'venv', 'env', '__pycache__', 'dist'} + def extract_comments(file_path): extension = os.path.splitext(file_path)[1] @@ -75,7 +73,7 @@ def scan(target_path): files = ( [path] if path.is_file() - else [f for f in path.rglob('*') if f.suffix in SUPPORTED_EXTENSIONS] + else [f for f in path.rglob('*') if f.suffix in SUPPORTED_EXTENSIONS and not any(part in EXCLUDE_DIRS for part in f.parts)] ) results = [] @@ -92,7 +90,7 @@ def scan(target_path): results.append({ "file": str(file), "avg_fog": round(avg, 1) if avg else None, - "max_fog": round(max_score, 1) if max_score else None, + "fog_score": round(max_score, 1) if max_score else None, "status_code": status }) diff --git a/.github/scripts/render-integrity-html.js b/.github/scripts/render-integrity-html.js index 254b8f9..e2e70f8 100644 --- a/.github/scripts/render-integrity-html.js +++ b/.github/scripts/render-integrity-html.js @@ -164,7 +164,7 @@ function buildQualitySection(key, data) { const results = data.results || [] const totalFiles = (data.summary && data.summary.total_files != null) ? data.summary.total_files : results.length - const violations = results.filter((r) => r.status_code !== 'OK' && r.status_code !== 'OK!') + const violations = results.filter((r) => r.status_code !== 'OK' && r.status_code !== 'OK!' && r.status_code !== 'NO DATA') const passed = totalFiles - violations.length const findingsHtml = violations.length === 0 @@ -172,7 +172,7 @@ function buildQualitySection(key, data) { : violations.map((r) => { const val = r[qm.metric] const display = typeof val === 'number' ? val.toFixed(qm.decimals) : (val ?? '?') - const lvl = (r.status_code === 'DANGER' || r.status_code === '⚠️ IMPROVE NAMING') ? 'error' : 'warning' + const lvl = (r.status_code === 'DANGER' || r.status_code === '⚠️ IMPROVE NAMING' || r.status_code === 'COMPLEX') ? 'error' : 'warning' return `