Coverex.Source
This module provides access to the source code the system to be analyzed.
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}
modules :: %{symbol => line_pairs}
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
Returns the aliased module name if there are any dots in its name
Returns the atom module name based on the (reversed) alias list
Specs:
- analyze_to_html(symbol) :: {line_entries, binary}
Specs:
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.
Strips the current directory from the path
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
Specs:
- generate_lines([{{symbol, pos_integer}, pos_integer}], line_pairs) :: line_entries
Specs:
- get_compile_info(atom) :: [{atom, term}]
Specs:
- get_quoted_source(atom) :: {Macro.t, binary}
Returns the quoted code and the source of a module
Specs:
- get_source_path(atom) :: {atom, binary}
Specs:
- lines_to_list(line_entries) :: [pos_integer | nil]
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.
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.