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) 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 Optional<FunctionSymbol>getOverriddenMethod(FunctionSymbol functionSymbol, Function<List<FunctionSymbol>, Optional<FunctionSymbol>> symbolPicker) static List<FunctionSymbol>getOverriddenMethods(FunctionSymbol functionSymbol) static booleanisEqualParameterCountAndNames(List<FunctionSymbol> alternatives) static booleanisPrivateName(String name) static PathpathOf(PythonFile pythonFile) static StringpythonPackageName(File file, String projectBaseDirAbsolutePath) static SymboltypeshedSymbolWithFQN(String fullyQualifiedName)
-
Method Details
-
getModuleFileName
-
fullyQualifiedModuleName
-
assignmentsLhs
-
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
-
getOverriddenMethod
public static Optional<FunctionSymbol> getOverriddenMethod(FunctionSymbol functionSymbol, Function<List<FunctionSymbol>, Optional<FunctionSymbol>> symbolPicker) -
getOverriddenMethods
-
getFunctionSymbols
-
getFirstAlternativeIfEqualArgumentNames
public static Optional<FunctionSymbol> getFirstAlternativeIfEqualArgumentNames(List<FunctionSymbol> alternatives) -
isEqualParameterCountAndNames
-
canBeAnOverridingMethod
-
typeshedSymbolWithFQN
-
flattenAmbiguousSymbols
-
isPrivateName
-