Codacy backlog: 443 issues, mostly Prospector/Pyflakes findings
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Aptitud para principiantes
- 45/100
- Tipo de issue
- Refactorización
- Claridad
- Bastante claro
- Estado de actividad
- Tranquilo
- Stack tecnológico
- python
- Área
- testing-qa, tooling
Línea de trabajo
Comienza con ruff check --select F src/machinevisiontoolbox tests e inspecciona las 29 ubicaciones F821 indicadas, distinguiendo los problemas reales en tiempo de ejecución del código muerto o inalcanzable y de los problemas en las pruebas. Prioriza o corrige primero esos hallazgos y luego ejecuta las pruebas pertinentes; esta fase se considera completada cuando se haya abordado cada hallazgo F821, mientras que las categorías de lint más amplias siguen siendo trabajo de seguimiento independiente.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
Raised 2026-07-29 when the user pointed at the repo's Codacy dashboard
(443 issues total) and asked how much overlaps with the mixin/hygiene
work happening the same day. Verified: only the bare-except finding
(see git history, since fixed) genuinely overlapped. Everything else is
a distinct, much larger body of work, deliberately not tackled in that
pass — logging the real numbers here instead of re-deriving them from
scratch next time.
Codacy's Python analysis engine is Prospector (bundles Pylint +
Pyflakes + Bandit + pycodestyle + pydocstyle + mccabe) — confirmed via
the dashboard's own "Prospector's documentation" tab, and pattern names
like Avoid Dangerous Mutable Default Arguments / Audit Dangerous Subprocess Usage that are textbook Pylint/Bandit rule names. Codacy's
298-count "Detect Python Source Code..." bucket is all Pyflakes
findings grouped under one umbrella pattern, not broken out by code the
way ruff/raw pyflakes do.
Reproduced locally with ruff check --select F src/machinevisiontoolbox tests against clean origin/main, 2026-07-30: 883 hits (not
directly comparable to Codacy's 298 — different default
exclusions/config, and this sweep includes tests/, which Codacy's
dashboard count may not). By code:
| Code | Count | What it means |
|---|---|---|
F405 |
469 | name may be undefined, or defined from star imports (ambiguous from X import *) |
F401 |
240 | imported but unused |
F841 |
49 | local variable assigned but never used |
F403 |
47 | from X import * used (can't verify no undefined names) |
F811 |
43 | redefinition of unused name from a prior import/def |
F821 |
29 | undefined name — see below, this is the one worth triaging first |
F541 |
6 | f-string missing placeholders |
F405/F403 (star-import ambiguity) dominate the count but are mostly
a style/tooling-friction issue, not bugs — this codebase leans on
from machinevisiontoolbox.base import *-style re-exports
deliberately (see the mypy wildcard-re-export issue for the
concrete downside of that pattern). F401/F841/F811 are typical
accumulated-cruft categories, individually low-risk to clean up but
numerous.
F821 (undefined name) is different — this is a real-bug class, not
style: a name that doesn't exist would raise NameError at runtime
if that code path is ever actually executed. All 29 instances, by
location:
BundleAdjust.py:382,590,592— undefinedc,retain,g2ImageSpatial.py:116,121,328,330-332,340-342,1106— undefined
_border_opt,border_value,value,a,kv(kvappears 4
times),connVisualServo.py:186,412,444,1351-1353,1403— undefinedAnimate,
plot,history,camera,SphericalCamera,kwargs,ptblocks/camera.py:287,288— undefinedstate(x2)tests/test_camera.py:191,192,194,195,198,200— undefinedx,y
(likely a real bug in the test, not production code — check
whether these lines actually run or are dead/unreachable test code)
Codacy's Pylint/Bandit-derived counts (the non-Pyflakes ~145 of the
443) weren't independently reproduced locally — the dashboard is the
source of truth for those categories (mutable default arguments,
assert usage, subprocess/exec/urlopen auditing, etc.).
Fix
Not a single pass. Suggested order: (1) triage the 29 F821 hits first
— for each, determine real bug vs. genuinely dead/unreachable code, fix
or delete accordingly; (2) F401/F811 next, mechanical and
ruff --fix-automatable for most cases; (3) F841 case-by-case (some
may be intentional, e.g. unpacking for side effects); (4) F405/F403
last and only if the codebase-wide star-import convention itself is
ever reconsidered — otherwise these will just regenerate.
Two more concrete instances, PRs #32/#33, 2026-07-30: Codacy
flagged type shadowing the builtin at ImageWholeFeatures.py:1213
(Histogram.plot's signature, PR #32) and again at :1570
(_compute_plot_series, the extraction in PR #33 that copied plot's
type parameter into a new method). Deliberately not renamed in
either PR — type= is public API (hist.plot(type="pdf")), a rename
needs a proper deprecation cycle. If picked up: this method
already has a precedent for exactly this — bar= is kept as a
deprecated alias for filled= with a DeprecationWarning
(ImageWholeFeatures.py, same method) — mirror that pattern: add
kind= as the real parameter, deprecate type= as an alias. Do this
as its own PR after #32 and #33 are both merged, not before —
branching the rename off pre-#32 main would conflict with both of
those on the same lines.
PR #33 also surfaced 3 more Codacy findings while extracting
Image.__getitem__'s nested closures (ImageCore.py): max as a
parameter name (:2792, _lenkey — carried over verbatim from the
original nested lenkey(key, max), not introduced by the extraction)
and two F405 star-import-ambiguity hits (:352 Dtype, :2812
Any, both from machinevisiontoolbox.mvtb_types's star-import) —
already covered by the F405 finding above, not a new pattern.
- Lenguaje dominante
- Python
- Estrellas
- 220
- Forks
- 30
- Merge medio
- 12 d 23 h
- PR fusionados (30 d)
- 5
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
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 petercorke/machinevision-toolbox-python
-
tech-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
-
tech-debt
Dificultad 2/5 1-3 horas Aptitud para principiantes 85/100
-
tech-debt
Dificultad 4/5 3-5 días Aptitud para principiantes 52/100
-
tech-debt
Dificultad 3/5 1-2 días Aptitud para principiantes 72/100
-
tech-debt
Dificultad 3/5 1-2 días Aptitud para principiantes 76/100
Todos los issues de petercorke/machinevision-toolbox-python
Issues similares
-
bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
stephrobert/dsoxlab#238 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 75/100
sublimehq/package_control#1780 ·
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 65/100
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 70/100
nwg-piotr/nwg-displays#145 ·