class Analyzer::Python::Python
- Analyzer::Python::Python
- Analyzer
- Reference
- Object
Direct Known Subclasses
Defined in:
analyzer/analyzers/python/python.crConstant Summary
-
DOT_NATION =
/[a-zA-Z_][a-zA-Z0-9_.]*/
-
Regex for valid Python module names
-
HTTP_METHODS =
["get", "post", "put", "patch", "delete", "head", "options", "trace"]
-
HTTP method names commonly used in REST APIs
-
INDENTATION_SIZE =
4
-
Indentation size in spaces; different sizes can cause analysis issues
-
PYTHON_VAR_NAME_REGEX =
/[a-zA-Z_][a-zA-Z0-9_]*/
-
Regex for valid Python variable names
Instance Method Summary
-
#find_imported_modules(app_base_path : String, file_path : String, content : String | Nil = nil) : Hash(String, Tuple(String, Int32))
Finds all the modules imported in a given Python file
-
#find_imported_package(package_path : String, dotted_as_names : String) : Array(Tuple(String, String, Int32))
Finds the package path for imported modules
-
#find_json_params(codeblock_lines : Array(String), json_var_names : Array(String)) : Array(Param)
Finds all parameters in JSON objects within a given code block
-
#parse_code_block(data : String | Array(String), after : Regex | Nil = nil) : String | Nil
Parses a function or class definition from a string or an array of strings
-
#parse_function_def(source_lines : Array(String), start_index : Int32) : FunctionDefinition | Nil
Parses the definition of a function from the source lines starting at a given index
-
#return_literal_value(data : String) : String
Returns the literal value from a string if it represents a number or a quoted string
Instance methods inherited from class Analyzer
analyze
analyze,
base_path : String
base_path,
logger : NoirLogger
logger,
result : Array(Endpoint)
result,
url : String
url
Constructor methods inherited from class Analyzer
new(options : Hash(String, YAML::Any))
new
Macros inherited from class Analyzer
define_getter_methods(names)
define_getter_methods
Instance Method Detail
Finds all the modules imported in a given Python file
Finds the package path for imported modules
Finds all parameters in JSON objects within a given code block
Parses a function or class definition from a string or an array of strings
Parses the definition of a function from the source lines starting at a given index
Returns the literal value from a string if it represents a number or a quoted string