jendrikseipp / vulture

Find dead Python code
MIT License
3.38k stars 148 forks source link

Don't print confidence for unused code #263

Closed mathbunnyru closed 1 year ago

mathbunnyru commented 3 years ago

Right now confidence doesn't make a lot of sense - as far as I understand, it is based purely on type of unused code and only has several possible values.

Instead, it would be better to have something like this: file.py:58: unused variable 'my_unused_var' (unused_variable)

And we will be able to filter out categories of unused code.

This will also solve issue: https://github.com/jendrikseipp/vulture/issues/261

RJ722 commented 2 years ago

I'm not sure I follow up correctly, but the category is anyways printed with the message:

 file.py:58: unused variable 'my_unused_var' (unused_variable)
             ^^^^^^^^^^^^^^^
mathbunnyru commented 2 years ago

Yes, you're right, what I meant is to get rid of confidence in its current implementation, because it's a bit misleading.

jendrikseipp commented 2 years ago

I updated the title accordingly. I like the --min-confidence feature and to make it useful we need to show confidence values. Maybe we should improve the docs about confidence values or improve the confidence values themselves, though.

hughhan1 commented 2 years ago

It feels that something like --strictness-level could be more accurate? Specific types of errors fall into different categories of strictness. The confidence level percentages seem to imply some probability that the code is unused, which is misleading—there is no probabilistic modeling done whatsoever.