github / github/codeql

False positive py/uninitialized-local-variable

Abierto
#18,390 3 comentarios 1 reacción 0 asignados Ver en GitHub
false-positive Python
Lenguaje dominante
CodeQL
Estrellas
10.1k
Forks
2.1k
Merge medio
2 d 15 h
PR fusionados (30 d)
141

Descripción

**Description of the false positive**

**Code samples or links to source code**

```python
class Foo:
def foo(self, a, b, c=0):
start = 0
visible = not (a == b and c)
end = start if visible else None
return end

```

CodeQL Version: 2.18.3

Alert : Local variable 'visible' may be used before it is initialized.

I suspect that the issue is caused by EssaVariable being unable to locate the assignment statement for the variable visible, but I'm not sure how to modify the ql statement.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Review the py/uninitialized-local-variable query and its EssaVariable handling against the supplied Python sample. Confirm that the false alert about visible no longer appears for this code while the intended uninitialized-local-variable detection remains intact.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
python
Área
security
Tipo de issue
Error
Dificultad
4/5
Tiempo estimado
3-5 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.