class AnalyzerDjango

Defined in:

analyzer/analyzers/analyzer_django.cr

Constant Summary

HTTP_METHOD_NAMES = ["get", "post", "put", "patch", "delete", "head", "options", "trace"]
INDENT_SPACE_SIZE = 4
REGEX_INCLUDE_URLS = /include\s*\(\s*r?['"]([^'"\\]*)['"]/
REGEX_ROOT_URLCONF = /\s*ROOT_URLCONF\s*=\s*r?['"]([^'"\\]*)['"]/
REGEX_ROUTE_MAPPING = /(?:url|path|register)\s*\(\s*r?['"]([^"']*)['"][^,]*,\s*([^),]*)/
REQUEST_PARAM_FIELD_MAP = {"GET" => {["GET"], "query"}, "POST" => {["POST"], "form"}, "COOKIES" => {nil, "header"}, "META" => {nil, "header"}, "data" => {["POST", "PUT", "PATCH"], "form"}}
REQUEST_PARAM_TYPE_MAP = {"query" => nil, "form" => ["GET", "POST", "PUT", "PATCH"], "cookie" => nil, "header" => nil}

Instance Method Summary

Instance methods inherited from class Analyzer

analyze analyze, base_path : String base_path, logger : NoirLogger logger, result : Array(Endpoint) result, scope : String scope, url : String url

Constructor methods inherited from class Analyzer

new(options : Hash(Symbol, String)) new

Macros inherited from class Analyzer

define_getter_methods(names) define_getter_methods

Instance Method Detail

def analyze #

[View source]
def get_endpoint_from_files(url : String, filepath : String, function_or_class_name : String) #

[View source]
def get_endpoints(django_urls : DjangoUrls) : Array(Endpoint) #

[View source]
def get_filtered_params(method : String, params : Array(Param)) #

[View source]
def parse_function_or_class(content : String) #

[View source]
def parse_import_packages(url_base_path : String, content : String) #

[View source]
def parse_params(line : String, endpoint_methods : Array(String)) #

[View source]
def search_root_django_urls_list : Array(DjangoUrls) #

[View source]
def travel_package(package_path, dotted_as_names) #

[View source]