Closed traverso-inspectifai closed 1 year ago
This is just due to a fundamental limitation of Vulture: it only looks at names and ignores scope completely. Such an approach is simpler to implement, but obviously leads to more false positives and false negatives.
Hi,
I was building my own whitelist and I realized that vulture is just paying attention to the last name of each element in the whitelist. For example, if in your whitelist you have
argparse.ArgumentParser().epilog
, then everyepilog
attribute is whitelisted, even if it is inside of another class like this:The output of vulture is as follows:
Thus, vulture is able to detect that neither de Dummy class nor the dummy_argument are used. However, it does not show any warning regarding epilog. This is because I imported argparse and therefore the
argparse_whitelist.py
file was automatically imported by vulture.My expectation would be that vulture can differentiate between the two different
epilog
attributes. Whitelistingargparse.ArgumentParser().epilog
shouldn't whitelist alsoDummy().epilog
.Is my expectation wrong or is it a bug in the current implementation of vulture?