github / github/codeql

LGTM.com - false positive (captured variable)

Abierto
#6,457 1 comentario 0 reacciones 0 asignados Ver en GitHub
acknowledged false-positive not security 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**

A variable is defined inside a function, and later used/access from a nested function as follows:

```
def manage_dvs(request) -> str:
...
curr_fake_platform = None
...
def update_dvs(log_path, new_fake_platform=None):
...
nonlocal curr_fake_platform
if new_fake_platform != curr_fake_platform:
...
```

The `curr_fake_platform` incorrectly triggers an unused variable alert

**URL to the alert on the project page on LGTM.com**
https://lgtm.com/projects/g/Azure/sonic-swss/snapshot/b5ac9505d8ac0a7830488d825aae7e616480cc86/files/tests/conftest.py?sort=name&dir=ASC&mode=heatmap#xd660241c258f5ae6:1

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.