Coverex - Coverage Reports for Elixir v1.4.12 Coverex.Source

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

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

Types

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

Functions

alias_mod(mod)

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

alias_to_atom(a)

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

analyze_to_html(mod)

Specs

analyze_to_html(symbol) :: {line_entries, binary}
cover_per_mod(mod)

Specs

cover_per_mod(symbol) :: [lines]
coveralls_data(mods)

Specs

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.

filter_cwd_prefix(path)

Strips the current directory from the path

find_all_mods_and_funs(qs)

Specs

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

generate_lines(cover, mod_entry)

Specs

generate_lines([{{symbol, pos_integer}, pos_integer}], line_pairs) :: line_entries
get_compile_info(mod)

Specs

get_compile_info(atom) :: [{atom, term}]
get_quoted_source(mod)

Specs

get_quoted_source(atom) :: {Macro.t, binary}

Returns the quoted code and the source of a module

get_source_path(mod)

Specs

get_source_path(atom) :: {atom, binary}
lines_to_list(lines)

Specs

lines_to_list(line_entries) :: [pos_integer | nil]
merge_coverage(mods)

Specs

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.

sources_and_lines(mods)

Specs

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.