Visualize.Audit.CodeScan (Visualize v0.2.35)

Copy Markdown View Source

Every public function lib/ defines, read from source without compiling it.

A definition is public when it is a def, defmacro, defguard or defdelegate that Elixir would document: @doc false hides every arity of the definition it precedes, and @impl without an explicit @doc hides it likewise, default-argument arities included (what Code.fetch_docs/1 reports). Functions a use injects are not in the source: a module that generates its injections declares them through a zero-arity injected export, which the scanner asks for, and GenServer is listed here (spec/12 §2).

Each function is versioned with Surfex.SourceScan.definition_hash/1 over all of its clauses, so the golden's Version column changes when the definition changes and not when the file is reformatted or something above it moves.

Summary

Functions

Every function definition under root's lib/, in {module, name, arity} order.

Scans one source file; root makes the recorded path relative.

Scans a source string; file is what the entries record as their locus.

Types

entry()

@type entry() :: %{
  module: String.t(),
  name: atom(),
  arity: non_neg_integer(),
  hidden?: boolean(),
  version: String.t(),
  file: String.t()
}

Functions

run(root)

@spec run(String.t()) :: [entry()]

Every function definition under root's lib/, in {module, name, arity} order.

scan_file(path, root)

@spec scan_file(String.t(), String.t()) :: [entry()]

Scans one source file; root makes the recorded path relative.

scan_source(source, file)

@spec scan_source(String.t(), String.t()) :: [entry()]

Scans a source string; file is what the entries record as their locus.