[Bug] Symfony Console commands and EventSubscribers are reported as unused exports
Maintainers usually reply within 1 day
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 55/100
Research direction
Start with ingestion/framework_edges/laravel.py as the model for a new Symfony handler, and find where SYMFONY is defined in ingestion/framework_facts.py (around lines 85-87). Check the *Command pattern in analysis/dead_code/constants.py near line 1138 to see what it misses. Done means classes extending Symfony's Command or implementing EventSubscriberInterface become roots, while Plain and a local non-Symfony Command stay flagged, as covered by a new tests/unit/dead_code/test_symfony_liveness.py.
Written by the indexing model from the issue text.
Description
Summary
A class extending Symfony's Console Command or implementing EventSubscriberInterface is loaded by the container or a command loader, never imported, so it is reported as an unused_export and an unreachable_file. Laravel has liveness edges; Symfony has only detection facts.
packages/core/src/repowise/core/ingestion/framework_facts.py:85-87
SYMFONY = FrameworkFacts(
name="Symfony",
composer_packages=("symfony/framework-bundle", "symfony/symfony"),
Mechanism
ingestion/framework_edges/holdslaravel.pyandtypo3.pyfor PHP and nothing for Symfony.- The only name-based help is the
*Commanddynamic pattern (analysis/dead_code/constants.py:1138), which misses a command class not named...Commandand every subscriber. - Detection is the wrong gate: an app can use
symfony/consolealone, withoutsymfony/framework-bundle, socomposer_packagesmisses it. The class shape is the signal:extends Commandorimplements EventSubscriberInterface, resolved to theSymfony\Component\...import.
Repro
composer.json require symfony/console, symfony/event-dispatcher; psr-4 "Acme\\": "src/"
src/Cmd/Hello.php use Symfony\Component\Console\Command\Command; class Hello extends Command { execute(...) }
src/Events/Sub.php use Symfony\Component\EventDispatcher\EventSubscriberInterface; class Sub implements EventSubscriberInterface { getSubscribedEvents() }
src/Util/Plain.php class Plain {} (control)
repowise init --mode fast --no-prose, then repowise dead-code --format json on main:
unused_export src/Cmd/Hello.php Hello 0.6
unused_export src/Events/Sub.php Sub 0.6
unused_export src/Util/Plain.php Plain 0.6
unreachable_file src/Cmd/Hello.php 0.4
unreachable_file src/Events/Sub.php 0.4
unreachable_file src/Util/Plain.php 0.4
Impact
Symfony apps and CLIs with many commands or subscribers get a long false-positive list.
Done looks like
- Classes extending Symfony's
Commandor implementing itsEventSubscriberInterfacebecome reachability roots, in a handler besidelaravel.py. Plainstays flagged, and so does a class extending a localCommandthat is not Symfony's.- Decide whether
#[AsCommand]and#[AsEventListener]attributes count too. - Help wanted: needs import-resolved base-class matching and that attribute decision.
Tests
A new tests/unit/dead_code/test_symfony_liveness.py, modelled on test_laravel_liveness.py, with the three classes above.
- Dominant language
- Python
- Stars
- 7.1k
- Forks
- 756
- Avg merge
- 21h 5m
- Merged PRs (30d)
- 797
Getting set up
- No Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from repowise-dev/repowise
-
[Bug] Elixir `.formatter.exs`, `.credo.exs`, `config/*.exs` and `priv/**/*.exs` are reported as unreachable filesPossibly taken @ZYZ666-RGB claimed this 1 day ago. Openbug good first issue
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#6296 · 1 comment ·
Maintainers usually reply within 1 day
-
[Bug] Coverage stack detection omits Swift, Dart, and Scala, falling through to UNKNOWN in evidence setupPossibly taken @RishabhIIITD claimed this 2 days ago. Openbug
Difficulty 2/5 1-3 hours Newbie friendliness 80/100
repowise-dev/repowise#5838 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug] PR-mined decisions store the decision sentence again as their rationalePossibly taken @suyashgitt claimed this 11 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#5702 · 2 comments ·
Maintainers usually reply within 1 day
-
[Bug] CICS CSD `DEFINE _PGMLIST` startup programs (`_PGMPH`) are not rootsPossibly taken @dchaudhari7177 claimed this 34 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
repowise-dev/repowise#4477 ·
Maintainers usually reply within 1 day
-
[Bug] COBOL listing directives EJECT, SKIP1/SKIP2/SKIP3 and TITLE fail to parse and drop the rest of the filePossibly taken @dchaudhari7177 claimed this 34 days ago. Openbug good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 91/100
repowise-dev/repowise#4474 ·
Maintainers usually reply within 1 day
All issues in repowise-dev/repowise
Similar issues
-
triage
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
kornia/kornia-rs#1416 · 1 comment ·
Maintainers usually reply within 2 days
-
ui
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
PolicyEngine/ai-inequality#64 ·
Maintainers usually reply within 1 day
-
LinearGaussianStateSpace.dist splits states and observations wrongly when the transition varies over timePossibly taken @PabloRoque claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
pymc-devs/pymc-extras#839 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day