Empty output when calculating metrics for this function in C
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
Línea de trabajo
Start with the C parser and metric extraction paths in rust-code-analysis; the issue does not name specific files or tests. Run the provided rust-code-analysis-cli command on the reproducer and inspect how the parser's ERROR nodes affect function metric collection. Done means the function produces metrics for this input, with a regression test covering the case.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Description
I attempted to extract code metrics from a certain function, but the output turned out to be empty. I discovered that there are multiple nodes labeled as ERROR in AST. Is it caused by this?
Steps to reproduce
The command I tried
$ rust-code-analysis-cli --paths foo.c -m
The code
static YYACTIONTYPE
yy_find_shift_action(YYCODETYPE iLookAhead, /* The look-ahead token */
YYACTIONTYPE stateno /* Current state number */
) {
int i;
if (stateno > YY_MAX_SHIFT)
return stateno;
assert(stateno <= YY_SHIFT_COUNT);
#if defined(YYCOVERAGE)
yycoverage[stateno][iLookAhead] = 1;
#endif
do {
i = yy_shift_ofst[stateno];
assert(i >= 0);
/* assert( i+YYNTOKEN<=(int)YY_NLOOKAHEAD ); */
assert(iLookAhead != YYNOCODE);
assert(iLookAhead < YYNTOKEN);
i += iLookAhead;
if (i >= YY_NLOOKAHEAD || yy_lookahead[i] != iLookAhead) {
#ifdef YYFALLBACK
YYCODETYPE iFallback; /* Fallback token */
if (iLookAhead < sizeof(yyFallback) / sizeof(yyFallback[0]) &&
(iFallback = yyFallback[iLookAhead]) != 0) {
#ifndef NDEBUG
if (yyTraceFILE) {
fprintf(yyTraceFILE, "%sFALLBACK %s => %s\n", yyTracePrompt,
yyTokenName[iLookAhead], yyTokenName[iFallback]);
}
#endif
assert(yyFallback[iFallback] == 0); /* Fallback loop must terminate */
iLookAhead = iFallback;
continue;
}
#endif
#ifdef YYWILDCARD
{
int j = i - iLookAhead + YYWILDCARD;
if (
#if YY_SHIFT_MIN + YYWILDCARD < 0
j >= 0 &&
#endif
#if YY_SHIFT_MAX + YYWILDCARD >= YY_ACTTAB_COUNT
j < YY_ACTTAB_COUNT &&
#endif
j < (int)(sizeof(yy_lookahead) / sizeof(yy_lookahead[0])) &&
yy_lookahead[j] == YYWILDCARD && iLookAhead > 0) {
#ifndef NDEBUG
if (yyTraceFILE) {
fprintf(yyTraceFILE, "%sWILDCARD %s => %s\n", yyTracePrompt,
yyTokenName[iLookAhead], yyTokenName[YYWILDCARD]);
}
#endif /* NDEBUG */
return yy_action[j];
}
}
#endif /* YYWILDCARD */
return yy_default[stateno];
} else {
return yy_action[i];
}
} while (1);
}
- Lenguaje dominante
- Rust
- Estrellas
- 469
- Forks
- 74
- Merge medio
- 17 h 16 min
- PR fusionados (30 d)
- 10
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
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 mozilla/rust-code-analysis
-
mozcpp: refresh the list of Mozilla annotation macrosPosiblemente ocupada Un pull request vinculado a esta issue está abierto o ya se fusionó. Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
mozilla/rust-code-analysis#1267 ·
Los mantenedores suelen responder en 1 día
-
mozcpp: parse a string literal followed by a PRI*/SCN* format macroPosiblemente ocupada @marco-c la tomó hace 2 días. Abierto
Dificultad 4/5 3-5 días Aptitud para principiantes 15/100
mozilla/rust-code-analysis#1266 ·
Los mantenedores suelen responder en 1 día
-
Grammar check tasks compare unrelated files and skip most of the othersQuizá libre de nuevo Un pull request para esta issue se cerró sin fusionarse. Abierto
Dificultad 3/5 1-2 días Aptitud para principiantes 45/100
mozilla/rust-code-analysis#1261 · 1 comentario ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
mozilla/rust-code-analysis#1250 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 4/5 3-5 días Aptitud para principiantes 48/100
mozilla/rust-code-analysis#1249 ·
Los mantenedores suelen responder en 1 día
Todos los issues de mozilla/rust-code-analysis
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 68/100
Los mantenedores suelen responder en 1 día
-
Dificultad 1/5 Menos de una hora Aptitud para principiantes 92/100
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 80/100
speakeasy-api/speakeasy#2159 ·
Los mantenedores suelen responder en 1 día
-
documentation target:powerpoint
Dificultad 1/5 Menos de una hora Aptitud para principiantes 76/100
tomast1337/PdfLapas#602 ·
Los mantenedores suelen responder en 1 día
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
r-lib/rig#535 · 2 comentarios ·
Los mantenedores suelen responder en 1 día