module BasicMetrics:sig
..end
Defining base metrics and operations on those
type
t = {
|
cfile_name : |
(* | Filename | *) |
|
cfunc : |
(* | Function name if applicable
( | *) |
|
cslocs : |
(* | Lines of code w.r.t. statements | *) |
|
cifs : |
(* | If / cases of switch | *) |
|
cloops : |
(* | Loops: for, while, do...while | *) |
|
ccalls : |
(* | Function calls | *) |
|
cgotos : |
(* | Gotos | *) |
|
cassigns : |
(* | Assignments | *) |
|
cexits : |
(* | Exit points: return | *) |
|
cfuncs : |
(* | Functions defined: 1 in the case of a single function, possibly more for a file. | *) |
|
cptrs : |
(* | Access to pointers | *) |
|
cdecision_points : |
(* | Decision points of the program: ifs, switch cases, exception handlers, ... | *) |
|
cglob_vars : |
(* | Global variables | *) |
|
ccyclo : |
(* | Cyclomatic complexity | *) |
}
Simple type of metrics.
val incr_funcs : t -> t
Helpers for metrics purposes for single increment steps
val incr_slocs : t -> t
val incr_ptrs : t -> t
val incr_ifs : t -> t
val incr_dpoints : t -> t
val incr_loops : t -> t
val incr_gotos : t -> t
val incr_exits : t -> t
val incr_assigns : t -> t
val incr_calls : t -> t
val incr_glob_vars : t -> t
val set_cyclo : t -> int -> t
val apply_then_set : (t -> t) ->
t Stdlib.ref -> unit
Update a reference from a pure functional function. Used in particular in combination with helper functions above.
val empty_metrics : t
Initial empty values for metrics computing.
val compute_cyclo : t -> int
Compute cyclomatic complexity from base_metrics record type.
val to_list : t -> string list list
Matrix-like representation of the record in "Title: value" style
val pp_base_metrics : Stdlib.Format.formatter -> t -> unit
Pretty printers for base metrics as text or html.
val pp_base_metrics_as_html_row : Stdlib.Format.formatter -> t -> unit