Module Metrics_base.BasicMetrics

module BasicMetrics: sig .. end
Defining base metrics and operations on those


Record type to compute cyclomatic complexity
type t = {
   cfile_name : string; (*
Filename
*)
   cfunc_name : string; (*
Function name if applicable, eg. not for global metrics
*)
   cslocs : int; (*
Lines of code w.r.t. statements
*)
   cifs : int; (*
If / cases of switch
*)
   cloops : int; (*
Loops: for, while, do...while
*)
   ccalls : int; (*
Function calls
*)
   cgotos : int; (*
Gotos
*)
   cassigns : int; (*
Assignments
*)
   cexits : int; (*
Exit points: return
*)
   cfuncs : int; (*
Functions defined: 1 in the case of a single function, possibly more for a file.
*)
   cptrs : int; (*
Access to pointers
*)
   cdecision_points : int; (*
Decision points of the program: ifs, switch cases, exception handlers, ...
*)
   cglob_vars : int; (*
Global variables
*)
}
Simple type of metrics.
val empty_metrics : t
Initial empty values for metrics computing.
val apply_then_set : ('a -> 'a) -> 'a Pervasives.ref -> unit
Update a reference from a pure functional function. Used in particular in combination with helper functions above.
val incr_slocs : t -> t
val incr_assigns : t -> t
val incr_calls : t -> t
val incr_exits : t -> t
val incr_funcs : t -> t
Helpers for metrics purposes for single increment steps
val incr_gotos : t -> t
val incr_ifs : t -> t
val incr_loops : t -> t
val incr_ptrs : t -> t
val incr_dpoints : t -> t
val incr_glob_vars : t -> t
val cyclo : t -> int
Compute cyclomatic complexity from base_metrics record type.
val labels : string list
val str_values : t -> string list
val to_list : t -> string list list
Matrix-like representation of the record in "Title: value" stytle
val pp_base_metrics : Format.formatter -> t -> unit
Pretty printers for base metrics as text or html.
val pp_strg : Format.formatter -> string -> unit
val pp_int : Format.formatter -> int -> unit
type cell_type = 
| Classic
| Entry
| Result
val cell_type_to_string : cell_type -> string
val pp_cell_type_html : Format.formatter -> cell_type -> unit
val pp_cell : cell_type ->
(Format.formatter -> 'a -> unit) -> Format.formatter -> 'a -> unit
val pp_cell_default : (Format.formatter -> int -> unit) -> Format.formatter -> int -> unit
val pp_base_metrics_as_html_row : Format.formatter -> t -> unit