nada_dsl.audit.report module
Common functions that Nada DSL static analysis submodules can use to build interactive HTML reports.
- parse(source: str) Tuple[ASTTokens, List[int]][source]
Parse a Python source string that represents a Nada DSL program and return both its abstract syntax tree and a list of which lines were skipped by the partial parser due to syntax errors.
- locations(report_, asttokens_, a)[source]
Return the starting and ending locations corresponding to an
astnode.
- type_to_str(t)[source]
Convert a type and/or type error
astnode attribute into a human-readable string.
- enrich_from_type(report_, type_, start, end)[source]
Enrich a range within a report according to the supplied type attribute.
- enrich_syntaxrestriction(report_, r, start, end)[source]
Enrich a range within a report according to the supplied syntax restriction.
- enrich_keyword(report_, start, length)[source]
Enrich a range within a report corresponding to a Python keyword.