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 `
${chip(lvl)}
@@ -225,7 +225,7 @@ const qualitySummaryRows = quality const qm = QUALITY_META[key] const data = quality[key] const status = qualityJobStatus(data) - const violations = data ? (data.results || []).filter((r) => r.status_code !== 'OK' && r.status_code !== 'OK!').length : 0 + const violations = data ? (data.results || []).filter((r) => r.status_code !== 'OK' && r.status_code !== 'OK!' && r.status_code !== 'NO DATA').length : 0 return ` ${qm.icon} ${esc(qm.name)} diff --git a/.github/workflows/quality-pipeline.yml b/.github/workflows/quality-pipeline.yml index 224ffbc..5aaadf7 100644 --- a/.github/workflows/quality-pipeline.yml +++ b/.github/workflows/quality-pipeline.yml @@ -328,7 +328,7 @@ jobs: - name: Run fog index analysis run: | mkdir -p quality-job4 - python .github/scripts/fog_comments_indexGP.py src/ \ + python .github/scripts/fog_comments_indexGP.py . \ > quality-job4/fog-results.json cat quality-job4/fog-results.json diff --git a/Templates/Details/details_base.html b/Templates/Details/details_base.html index 6258c36..9869585 100644 --- a/Templates/Details/details_base.html +++ b/Templates/Details/details_base.html @@ -22,7 +22,6 @@

{{ content.title }}

- {# Los archivos hijos (movie_detail y series_detail) rellenarán esto #} {% block content_metadata %}{% endblock %} {% if content.director %} @@ -31,8 +30,17 @@

{{ content.title }}

{{ content.director.name }}
{% endif %} - - {% block platforms %}{% endblock %} + +
+
Disponible en:
+
+ {% for api in available_apis %} + {{ api.name|default:api.port }} + {% empty %} + No hay información de API disponible. + {% endfor %} +
+
@@ -64,14 +72,12 @@

Acciones

if (favoriteBtn) { favoriteBtn.addEventListener('click', function() { - // Lee la URL específica generada por el bloque de Django const targetUrl = this.getAttribute('data-url'); const btn = this; fetch(targetUrl, { method: 'POST', headers: { - // Al estar incrustado en el template, Django inyecta el token aquí directamente 'X-CSRFToken': '{{ csrf_token }}', 'Content-Type': 'application/json' } @@ -81,7 +87,6 @@

Acciones

return response.json(); }) .then(data => { - // Actualización directa de la interfaz gráfica if (data.status === 'added') { btn.innerText = 'Quitar de la lista'; btn.style.color = 'var(--cyan)'; diff --git a/Templates/base.html b/Templates/base.html index c7f5a31..d405f5a 100644 --- a/Templates/base.html +++ b/Templates/base.html @@ -32,8 +32,6 @@ {% if user.is_authenticated %} {% trans "Welcome" %} {{ user.username }} {% endif %} - -