Contexted.ModuleAnalyzer (contexted v0.3.0)

The Contexted.ModuleAnalyzer defines utils functions that analyze and extract information from other modules.

Link to this section Summary

Functions

Generates a list of unique argument names based on the given arity.

Finds and returns the @doc definition in string format for the specified function name and arity. Returns nil if the function is not found in the function docs.

Finds and returns the @spec definition in string format for the specified function name and arity. Returns nil if the function is not found in the specs.

Fetches the @doc definitions for all functions within the given module.

Fetches the @spec definitions for all functions within the given module.

Link to this section Functions

Link to this function

generate_random_function_arguments(arity)

@spec generate_random_function_arguments(non_neg_integer()) :: [atom()]

Generates a list of unique argument names based on the given arity.

Link to this function

get_function_doc(functions_docs, name, arity)

@spec get_function_doc([tuple()], atom(), non_neg_integer()) :: String.t() | nil

Finds and returns the @doc definition in string format for the specified function name and arity. Returns nil if the function is not found in the function docs.

Link to this function

get_function_spec(specs, function_name, arity)

@spec get_function_spec([tuple()], atom(), non_neg_integer()) :: String.t() | nil

Finds and returns the @spec definition in string format for the specified function name and arity. Returns nil if the function is not found in the specs.

Link to this function

get_functions_docs(module)

@spec get_functions_docs(module()) :: [tuple()]

Fetches the @doc definitions for all functions within the given module.

Link to this function

get_functions_specs(module)

@spec get_functions_specs(module()) :: [tuple()]

Fetches the @spec definitions for all functions within the given module.