Package org.sonar.python.semantic
Class SymbolUtils
- java.lang.Object
-
- org.sonar.python.semantic.SymbolUtils
-
public class SymbolUtils extends Object
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static List<Expression>assignmentsLhs(AssignmentStatement assignmentStatement)static Map<String,Set<Symbol>>externalModulesSymbols()static intfirstParameterOffset(FunctionSymbol functionSymbol, boolean isStaticCall)static StringfullyQualifiedModuleName(String packageName, String fileName)static Set<Symbol>globalSymbols(FileInput fileInput, String packageName, PythonFile pythonFile)static booleanisTypeShedFile(PythonFile pythonFile)static PathpathOf(PythonFile pythonFile)static StringpythonPackageName(File file, File projectBaseDir)
-
-
-
Method Detail
-
fullyQualifiedModuleName
public static String fullyQualifiedModuleName(String packageName, String fileName)
-
globalSymbols
public static Set<Symbol> globalSymbols(FileInput fileInput, String packageName, PythonFile pythonFile)
-
assignmentsLhs
public static List<Expression> assignmentsLhs(AssignmentStatement assignmentStatement)
-
pathOf
@CheckForNull public static Path pathOf(PythonFile pythonFile)
-
isTypeShedFile
public static boolean isTypeShedFile(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)
-
-