Module Metrics_cilast

module Metrics_cilast: sig .. end
In the definitions below, setting argument libc to true will include functions/variables from the C stdlib in the metrics.

Syntactic metrics ================= The goal is to collect various (syntactic) information about the source code (slocs, assignments, loops, ...). From those one can compute McCabe's cyclomatic complexity.


class type sloc_visitor = object .. end
Visitor to compute various syntactic metrics.
class slocVisitor : libc:bool -> sloc_visitor
val get_metrics : libc:bool -> Metrics_base.BasicMetrics.t
type cilast_metrics = {
   fundecl_calls : int Metrics_base.VInfoMap.t;
   fundef_calls : int Metrics_base.VInfoMap.t;
   extern_global_vars : Metrics_base.VInfoSet.t;
   basic_metrics : Metrics_base.BasicMetrics.t;
}
val get_cilast_metrics : libc:bool -> cilast_metrics
val compute_on_cilast : libc:bool -> unit
Compute metrics on whole CIL AST
val compute_locals_size : Kernel_function.t -> unit
Compute and print the size (in bytes) of local variables on the CIL AST. This is a rough approximation, neither guaranteed to be smaller or larger than the actual value. Only automatic, non-ghost and non-temporary variables present in the source are included. This is useful to estimate the stack size of a function.