Ragex. Analysis. MetaCredoBridge
(Ragex v0.17.1)
View Source
Bridge between MetaCredo's check system and Ragex's analysis modules.
Provides helpers for:
- Parsing source files into
MetaCredo.SourceFilestructs - Running MetaCredo checks and collecting issues
- Converting
MetaCredo.Issuestructs to Ragex's internal formats (business logic issues, security vulnerabilities, code smells)
Summary
Functions
Converts a MetaCredo.Issue to Ragex's business logic issue format.
Converts a MetaCredo.Issue to Ragex's smell format.
Converts a MetaCredo.Issue to Ragex's security vulnerability format.
Parses a file into a MetaCredo.SourceFile.
Builds a MetaCredo.SourceFile from already-read content.
Runs a list of MetaCredo check modules on a source file.
Functions
@spec issue_to_ragex_issue(MetaCredo.Issue.t(), String.t()) :: map()
Converts a MetaCredo.Issue to Ragex's business logic issue format.
@spec issue_to_smell(MetaCredo.Issue.t()) :: map()
Converts a MetaCredo.Issue to Ragex's smell format.
@spec issue_to_vulnerability(MetaCredo.Issue.t(), String.t(), atom()) :: map()
Converts a MetaCredo.Issue to Ragex's security vulnerability format.
@spec parse_file(String.t()) :: {:ok, MetaCredo.SourceFile.t()} | {:error, term()}
Parses a file into a MetaCredo.SourceFile.
Returns {:ok, source_file} or {:error, reason}.
@spec parse_source_file(String.t(), String.t(), atom()) :: {:ok, MetaCredo.SourceFile.t()} | {:error, term()}
Builds a MetaCredo.SourceFile from already-read content.
@spec run_checks(MetaCredo.SourceFile.t(), [{module(), keyword()}]) :: [ MetaCredo.Issue.t() ]
Runs a list of MetaCredo check modules on a source file.
checks is a list of {module, params} tuples, matching MetaCredo's convention.
Returns a flat list of MetaCredo.Issue structs.