Created
April 30, 2020 18:11
-
-
Save mallamanis/ad9c0baf38fc822d9fcfbe1de7f4920e to your computer and use it in GitHub Desktop.
Prefer invocation to hash()
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @name Use hash() | |
* @description use hash() instead of __hash__ | |
* @kind problem | |
* @tags maintainability | |
* @problem.severity recommendation | |
* @sub-severity low | |
* @precision high | |
* @tags style | |
* @sub-severity low | |
* @id py/use-hash | |
*/ | |
import python | |
from Call call | |
where | |
call.getFunc().(Attribute).getName() = "__hash__" | |
select call, "Use built-in hash() instead." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment