Package org.sonar.python.semantic
Class SymbolUtils
java.lang.Object
org.sonar.python.semantic.SymbolUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic List<Expression> assignmentsLhs(AssignmentStatement assignmentStatement) boundNamesFromExpression(Tree tree) static booleancanBeAnOverridingMethod(FunctionSymbol functionSymbol) static intfirstParameterOffset(FunctionSymbol functionSymbol, boolean isStaticCall) flattenAmbiguousSymbols(Set<Symbol> symbols) static StringfullyQualifiedModuleName(String packageName, String fileName) static Optional<FunctionSymbol> getFirstAlternativeIfEqualArgumentNames(List<FunctionSymbol> alternatives) static List<FunctionSymbol> getFunctionSymbols(Symbol symbol) static StringgetModuleFileName(String fileName) static Optional<FunctionSymbol> getOverriddenMethod(FunctionSymbol functionSymbol) static List<FunctionSymbol> getOverriddenMethods(FunctionSymbol functionSymbol) static PythonTypegetPythonType(SymbolV2 symbol) static booleanisEqualParameterCountAndNames(List<FunctionSymbol> alternatives) static booleanisPrivateName(String name) static PathpathOf(PythonFile pythonFile) static StringpythonPackageName(File file, String projectBaseDirAbsolutePath) static StringqualifiedNameOrEmpty(CallExpression callExpression) symbolV2ToSymbolV1(SymbolV2 symbolV2) static SymboltypeshedSymbolWithFQN(String fullyQualifiedName)
-
Method Details
-
getModuleFileName
-
fullyQualifiedModuleName
-
assignmentsLhs
-
boundNamesFromExpression
-
pythonPackageName
-
pathOf
-
firstParameterOffset
- Returns:
- the offset between parameter position and argument position: 0 if there is no implicit first parameter (self, cls, etc...) 1 if there is an implicit first parameter -1 if unknown (intent is not clear from context)
-
getOverriddenMethod
-
getOverriddenMethods
-
getFunctionSymbols
-
getFirstAlternativeIfEqualArgumentNames
public static Optional<FunctionSymbol> getFirstAlternativeIfEqualArgumentNames(List<FunctionSymbol> alternatives) -
isEqualParameterCountAndNames
-
canBeAnOverridingMethod
-
typeshedSymbolWithFQN
-
flattenAmbiguousSymbols
-
isPrivateName
-
qualifiedNameOrEmpty
-
getPythonType
-
symbolV2ToSymbolV1
-