123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121(**************************************************************************)(* *)(* This file is part of Frama-C. *)(* *)(* Copyright (C) 2007-2023 *)(* CEA (Commissariat à l'énergie atomique et aux énergies *)(* alternatives) *)(* *)(* you can redistribute it and/or modify it under the terms of the GNU *)(* Lesser General Public License as published by the Free Software *)(* Foundation, version 2.1. *)(* *)(* It is distributed in the hope that it will be useful, *)(* but WITHOUT ANY WARRANTY; without even the implied warranty of *)(* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *)(* GNU Lesser General Public License for more details. *)(* *)(* See the GNU Lesser General Public License version 2.1 *)(* for more details (enclosed in the file licenses/LGPLv2.1). *)(* *)(**************************************************************************)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=Fc_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)(*
Local Variables:
compile-command: "make -C ../../.."
End:
*)