Coverex - Coverage Reports for Elixir v1.4.15 Coverex.Source View Source

This module provides access to the source code the system to be analyzed.

Link to this section Summary

Functions

Returns the aliased module name if there are any dots in its name

Returns the atom module name based on the (reversed) alias list

Returns the coverall data for the list of mods as Elixir datastructure. This can be encoded as JSON for uploading to coveralls

Strips the current directory from the path

Returns all modules and functions together with their start lines as they definend in the given quoted code

Returns the quoted code and the source of a module

Gets a list of all modules within one sourcefile. Calculates the coverage data for each module and merges them together. Returns a mapping of line number to coverage data for the entire source file. Guarantees that all line numbers up to the maximun reached line are filled in

This function aggregates the coverage information per module to a coverage information per source file

Link to this section Types

Link to this type line_entries() View Source
line_entries() :: %{optional(pos_integer) => {pos_integer | nil, binary | nil}}
Link to this type line_pairs() View Source
line_pairs() :: %{optional(symbol) => pos_integer}
Link to this type lines() View Source
lines() :: {pos_integer, pos_integer | nil}
Link to this type modules() View Source
modules() :: %{optional(symbol) => line_pairs}
Link to this type source_file() View Source
source_file() :: %{name: String.t, source: String.t, coverage: [pos_integer | nil]}
Link to this type symbol() View Source
symbol() :: :atom

Link to this section Functions

Returns the aliased module name if there are any dots in its name

Returns the atom module name based on the (reversed) alias list

Link to this function analyze_to_html(mod) View Source
analyze_to_html(symbol) :: {line_entries, binary}
Link to this function cover_per_mod(mod) View Source
cover_per_mod(symbol) :: [lines]
Link to this function coveralls_data(mods) View Source
coveralls_data([symbol]) :: [source_file]

Returns the coverall data for the list of mods as Elixir datastructure. This can be encoded as JSON for uploading to coveralls.

Strips the current directory from the path

Link to this function find_all_mods_and_funs(qs) View Source
find_all_mods_and_funs(any) :: modules

Returns all modules and functions together with their start lines as they definend in the given quoted code

Link to this function generate_lines(cover, mod_entry) View Source
generate_lines([{{symbol, pos_integer}, pos_integer}], line_pairs) :: line_entries
Link to this function get_compile_info(mod) View Source
get_compile_info(atom) :: [{atom, term}]
Link to this function get_quoted_source(mod) View Source
get_quoted_source(atom) :: {Macro.t, binary}

Returns the quoted code and the source of a module

Link to this function get_source_path(mod) View Source
get_source_path(atom) :: {atom, binary}
Link to this function lines_to_list(lines) View Source
lines_to_list(line_entries) :: [pos_integer | nil]
Link to this function merge_coverage(mods) View Source
merge_coverage([{symbol, lines}]) :: line_entries

Gets a list of all modules within one sourcefile. Calculates the coverage data for each module and merges them together. Returns a mapping of line number to coverage data for the entire source file. Guarantees that all line numbers up to the maximun reached line are filled in.

Link to this function sources_and_lines(mods) View Source
sources_and_lines([{symbol, [lines]}]) :: [{filename, line_entries}]

This function aggregates the coverage information per module to a coverage information per source file.

Takes a list of modules and determines the list of corresponding filenames. Returns to each filename a map of coverage information for the entire file.