code-complexity: nested callbacks are counted into the enclosing function, and object-literal-returning functions are never measured
Los mantenedores suelen responder en 1 día
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 35/100
- Tipo de issue
- Error
- Claridad
- Bastante claro
- Estado de actividad
- Activo
- Stack tecnológico
- typescript
- Área
- tooling
Línea de trabajo
Start with code-complexity-control.ts, especially lines 274–276, 336–365, and the file and function count checks at 130–174; read how the detector currently strips comments and finds function bodies. The issue suggests using TypeScript AST function-like nodes and ESLint’s complexity rule as a reference. Done means nested callbacks and literals no longer distort each function’s score, object-literal-returning functions are measured, and existing debt above 10 remains reported.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Found in the 8.0.0 self-audit triage: RoC 7.29.1 (npm, 5fc54afe) on a clean clone of develop at 2d2fa9a, with typescript resolvable (verdict compliance, 0 failed / 46 warnings). The bucket method and per-law tables are kept by QA; counts are from that run.
What happens
worstFunctionComplexityscores the brace body including inner functions (code-complexity-control.ts:336-365): 16 of 121 "function complexity" findings are an outer function charged with its callbacks (e.g. a score of 13 for a function whose own complexity is about 3).- Keywords,
?,||and braces inside strings/regex literals are counted and used for brace matching (only comments are stripped, :274-276): 23 more findings, e.g. a "function" scored 39 because brace matching ran on for 200 lines. - The other way round: a function whose return type is a multi-line object literal is never measured (admitted in the comment at :339-343); in already-flagged files this hides at least 12 functions over 10 (e.g. error-handling-completeness.ts:106, own complexity 22).
- File length counts comment and blank lines (:130-139) and applies to data/constant tables; "too many functions" is a per-file ceiling independent of complexity (:148-174). These are threshold questions for the maintainers.
The detector reproduces exactly (121 of 121 worst-function numbers); 82 functions are genuinely over 10 and stay as debt.
Suggested direction
Standard per-function cyclomatic complexity of each function's own body (as ESLint's complexity rule), from the TypeScript AST; measure every function-like node.
- Lenguaje dominante
- TypeScript
- Estrellas
- 0
- Forks
- 0
- Merge medio
- 38 min
- PR fusionados (30 d)
- 96
Preparar el entorno
- Sin Dockerfile ni archivo de Docker Compose
- Tiene una plantilla de pull request
- Leer la guía de contribución
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de Rule-Of-Code/RoC
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Rule-Of-Code/RoC#436 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 5/5 Más de una semana Aptitud para principiantes 35/100
Rule-Of-Code/RoC#439 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 4/5 3-5 días Aptitud para principiantes 49/100
Rule-Of-Code/RoC#438 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 53/100
Rule-Of-Code/RoC#437 ·
Los mantenedores suelen responder en 1 día
-
bug
Dificultad 3/5 1-2 días Aptitud para principiantes 74/100
Rule-Of-Code/RoC#435 ·
Los mantenedores suelen responder en 1 día
Todos los issues de Rule-Of-Code/RoC
Issues similares
-
ready-for-agent
Dificultad 1/5 Menos de una hora Aptitud para principiantes 86/100
LucasSantana-Dev/Lucky#3257 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
XiaomiMiMo/MiMo-Code#2849 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 67/100
danielmiessler/LifeOS#2894 ·
Los mantenedores suelen responder en 5 días
-
enhancement frontend good first issue help wanted testing-infrastructure
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 2 días
-
enhancement follow-up
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
Los mantenedores suelen responder en 1 día