Best practice
manual-defaultdict-dict-create
manual-defaultdict-dict-create
manually creating a defaultdict - use collections.defaultdict(dict)
manual-defaultdict-set-create
manual-defaultdict-set-create
manually creating a defaultdict - use collections.defaultdict(set)
manual-defaultdict-list-create
manual-defaultdict-list-create
manually creating a defaultdict - use collections.defaultdict(list)
manual-counter-create
manual-counter-create
manually creating a counter - use collections.Counter
hardcoded-tmp-path
hardcoded-tmp-path
Detected hardcoded temp directory. Consider using ‘tempfile.TemporaryFile’ instead.
missing-hash-with-eq
missing-hash-with-eq
Class $A
has defined __eq__
which means it should also have defined __hash__
;
pass-body-fn
pass-body-fn
pass
is the body of function $X. Consider removing this or raise NotImplementedError() if this is a TODO
pass-body-range
pass-body-range
pass
is the body of for Y. Consider removing this or raise NotImplementedError() if this is a TODO
arbitrary-sleep
arbitrary-sleep
time.sleep() call; did you mean to leave this in?
unspecified-open-encoding
unspecified-open-encoding
Missing ‘encoding’ parameter. ‘open()’ uses device locale encodings by default, corrupting files with special characters. Specify the encoding to ensure cross-platform support when opening files in text mode (e.g. encoding=“utf-8”).
open-never-closed
open-never-closed
file object opened without corresponding close
python-debugger-found
python-debugger-found
Importing the python debugger; did you mean to leave this in?
logging-error-without-handling
logging-error-without-handling
Errors should only be logged when handled. The code logs the error and propogates the exception, consider reducing the level to warning or info.