jendrikseipp / vulture

Find dead Python code
MIT License
3.48k stars 152 forks source link

Combine used_attrs and used_names to avoid false positives #223

Closed jingw closed 4 years ago

jingw commented 4 years ago

Description

This fixes false positives when assigning to x.some_name but reading via some_name. Note this produces false negatives in the opposite situation when x.some_name and some_name are different, so this is a trade-off in the direction of more precision / less sensitivity.

This direction is in line with pyflakes design principles: https://github.com/PyCQA/pyflakes#design-principles

it will try very, very hard to never emit false positives.

Fixing this more accurately probably requires a lot more work to trace references and analyze context.

Related Issue

221

Checklist:

jendrikseipp commented 4 years ago

Thanks!