Package org.sonar.python.checks.utils
Class CheckUtils
java.lang.Object
org.sonar.python.checks.utils.CheckUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanareEquivalent(Tree leftTree, Tree rightTree) static booleanclassHasInheritance(ClassDef classDef) static booleanstatic SymbolfindFirstParameterSymbol(FunctionDef functionDef) static ClassDefgetParentClassDef(Tree tree) static booleanisAbstract(FunctionDef funDef) static booleanisConstant(Expression condition) static booleanisConstantCollectionLiteral(Expression condition) static booleanisImmutableConstant(Expression condition) static booleanisNone(InferredType type) static booleanisSelf(Expression expression) Simple check whether the given expression is the "self" name expression.static booleanmustBeAProtocolLike(ClassDef classDef) Determines whether the given class must be a Protocol or a similar Protocol-like definition (e.g.
-
Method Details
-
areEquivalent
-
getParentClassDef
-
classHasInheritance
-
containsCallToLocalsFunction
-
isConstant
-
isImmutableConstant
-
isConstantCollectionLiteral
-
isNone
-
mustBeAProtocolLike
Determines whether the given class must be a Protocol or a similar Protocol-like definition (e.g.zope.interface.Interface). -
isAbstract
-
isSelf
Simple check whether the given expression is the "self" name expression. Carefully check the context when relying on this method! This implementation does not ensure that the name is actually referring to a method parameter or whether the surrounding method might be static, etc. -
findFirstParameterSymbol
-