Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Too many false positives #17

Open
ArneBachmannDLR opened this issue Mar 30, 2022 · 1 comment
Open

Too many false positives #17

ArneBachmannDLR opened this issue Mar 30, 2022 · 1 comment

Comments

@ArneBachmannDLR
Copy link

Great project! I found at least one line of code that could be improved (moved loop to a dictionary expression); but I see, however, 99.5% false positives, e.g.:

  • loop-try-except-usage can only be moved outside the loop, if the except clause contains a break. Otherwise I want to keep processing the loop
  • loop-invariant-statement is usually not at all invariant but depends on a loop variable
  • use-tuple-over-list is most often typed as a List[...] and therefore cannot and should not hold a tuple, even if initiated empty
@adamzev
Copy link

adamzev commented Jul 8, 2022

I enjoyed the talk and checking out the tool!

I ran into some issues with Pandas treating lists differently than tuples (when using them as keys).

I also hit a lot of false positives with loop-invariant-statements (unless I'm missing something).

I tried to simplify out an example of something it'd hit a false positive on:

keys = []
for record in ({'a': 4}, {'b': 8}):
    keys.append(tuple(k for k in record if k in ('b', 'c')))

print(keys)

I think it was saying k in ('b', 'c') was loop invariant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants