Coverex.Source

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

Source

Summary

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)
cover_per_mod(mod)
coveralls_data(mods)

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)

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

generate_lines(cover, mod_entry)
get_compile_info(mod)
get_quoted_source(mod)

Returns the quoted code and the source of a module

get_source_path(mod)
lines_to_list(lines)
merge_coverage(mods)

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)

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

Types

symbol :: :atom

line_pairs :: %{symbol => pos_integer}

line_entries :: %{pos_integer => {pos_integer | nil, binary | nil}}

source_file :: %{name: String.t, source: String.t, coverage: [pos_integer | nil]}

lines :: {pos_integer, pos_integer | nil}

Functions

alias_mod(mod)

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

Source
alias_to_atom(a)

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

Source
analyze_to_html(mod)

Specs:

Source
cover_per_mod(mod)

Specs:

Source
coveralls_data(mods)

Specs:

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

Source
filter_cwd_prefix(path)

Strips the current directory from the path

Source
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

Source
generate_lines(cover, mod_entry)

Specs:

Source
get_compile_info(mod)

Specs:

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

Specs:

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

Returns the quoted code and the source of a module

Source
get_source_path(mod)

Specs:

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

Specs:

Source
merge_coverage(mods)

Specs:

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.

Source
sources_and_lines(mods)

Specs:

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.

Source