Closed noorul closed 2 years ago
This is how it meant to be -- when the min-confidence
flag is supplied, only results with confidence greater than the supplied value are shown.
It'd be nice to know what you expected to happen here?
For the snippet, I was expecting vulture to report this unused function with 100%. Am I missing something?
Ah, I see. The confidence value is based on the 'type' of the unused item. For functions/methods, it is always 60%. For unused imports, it's 95%, and so on.
Then I am not sure whether I understood it properly. I set vulture to use a 70% confidence level because lower than that was giving false positive outputs. But this completely filtered out functions and methods.
In that case, to deal with false positives, I'd recommend adding a whitelist. You can even run Vulture with the --make-whitelist
flag -- this would print all the results in a form directly usable as a whitelist. More info in the README.
I managed to move to a 60% confidence level. I see that --make-whitelist is an option.
Reproduction recipe (test.py):
Vulture output: