vulture icon indicating copy to clipboard operation
vulture copied to clipboard

Don't print confidence for unused code

Open mathbunnyru opened this issue 2 years ago • 4 comments

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

mathbunnyru avatar Aug 22 '21 19:08 mathbunnyru

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)
             ^^^^^^^^^^^^^^^

RJ722 avatar Sep 05 '21 07:09 RJ722

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

mathbunnyru avatar Sep 05 '21 12:09 mathbunnyru

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.

jendrikseipp avatar Sep 06 '21 07:09 jendrikseipp

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.

hughhan1 avatar Dec 18 '21 15:12 hughhan1