123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101(**************************************************************************)(* *)(* SPDX-License-Identifier LGPL-2.1 *)(* Copyright (C) *)(* CEA (Commissariat à l'énergie atomique et aux énergies alternatives) *)(* *)(**************************************************************************)includePlugin.Register(structletname="metrics"letshortname="metrics"lethelp="syntactic metrics"end)moduleEnabled=WithOutput(structletoption_name="-metrics"lethelp="activate metrics computation"letoutput_by_default=trueend)moduleByFunction=WithOutput(structletoption_name="-metrics-by-function"lethelp="also compute metrics on a per-function basis"letoutput_by_default=trueend)moduleOutputFile=Filepath(structletoption_name="-metrics-output"letarg_name="filename"letfile_kind="Text, HTML or JSON"letexistence=Fclib.Filepath.Indifferentlethelp="print some metrics into the specified file; \
the output format is recognized through the extension: \
.text/.txt for text, .html/.htm for HTML, or .json for JSON."end)moduleValueCoverage=WithOutput(structletoption_name="-metrics-eva-cover"lethelp="estimate Eva coverage w.r.t. \
to reachable syntactic definitions"letoutput_by_default=trueend)let()=ValueCoverage.add_aliases["-metrics-value-cover"]moduleAstType=String(structletoption_name="-metrics-ast"letarg_name="[cabs | cil | acsl]"lethelp="apply metrics to Cabs or CIL AST, or to ACSL specs"letdefault="cil"end)moduleLibc=False(structletoption_name="-metrics-libc"lethelp="show functions from Frama-C standard C library in the \
results; deactivated by default."end)let()=AstType.set_possible_values["cil";"cabs";"acsl"]moduleSyntacticallyReachable=Kernel_function_set(structletoption_name="-metrics-cover"letarg_name="f1,..,fn"lethelp="compute an overapproximation of the functions reachable from \
f1,..,fn."end)moduleLocalsSize=Kernel_function_set(structletoption_name="-metrics-locals-size"letarg_name="f1,...,fn"lethelp="prints the size of local variables for functions f1,...,fn, \
and for the functions called within them \
(does not support recursive calls)"end)moduleUsedFiles=False(structletoption_name="-metrics-used-files"lethelp="list files containing global definitions reachable by main"end)