Package org.sonar.python.semantic
Class SymbolUtils
- java.lang.Object
-
- org.sonar.python.semantic.SymbolUtils
-
public class SymbolUtils extends Object
-
-
Method Summary
-
-
-
Method Detail
-
fullyQualifiedModuleName
public static String fullyQualifiedModuleName(String packageName, String fileName)
-
assignmentsLhs
public static List<Expression> assignmentsLhs(AssignmentStatement assignmentStatement)
-
pythonPackageName
public static String pythonPackageName(File file, String projectBaseDirAbsolutePath)
-
pathOf
@CheckForNull public static Path pathOf(PythonFile pythonFile)
-
firstParameterOffset
public static int firstParameterOffset(FunctionSymbol functionSymbol, boolean isStaticCall)
- 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
public static Optional<FunctionSymbol> getOverriddenMethod(FunctionSymbol functionSymbol)
-
getOverriddenMethod
public static Optional<FunctionSymbol> getOverriddenMethod(FunctionSymbol functionSymbol, Function<List<FunctionSymbol>,Optional<FunctionSymbol>> symbolPicker)
-
getOverriddenMethods
public static List<FunctionSymbol> getOverriddenMethods(FunctionSymbol functionSymbol)
-
getFunctionSymbols
public static List<FunctionSymbol> getFunctionSymbols(@Nullable Symbol symbol)
-
getFirstAlternativeIfEqualArgumentNames
public static Optional<FunctionSymbol> getFirstAlternativeIfEqualArgumentNames(List<FunctionSymbol> alternatives)
-
isEqualArgumentNames
public static boolean isEqualArgumentNames(List<FunctionSymbol> alternatives)
-
canBeAnOverridingMethod
public static boolean canBeAnOverridingMethod(@Nullable FunctionSymbol functionSymbol)
-
isPrivateName
public static boolean isPrivateName(String name)
-
-