--- layout: fc_discuss_archives title: Message 39 from Frama-C-discuss on May 2012 ---
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Frama-c-discuss] -metrics discrepency Boron/Nitrogen



There are multiple questions in your e-mail. I'll answer by the following
points:

* To the first question, the answer is yes and no. Some metrics on the
normalized AST could depend on the version of Frama-C (for example the
number of gotos). But cyclomatic complexity should not.
* What you (seem to) want (ie metrics on the source AST) exists, it is
described in
the metrics plug-in's manual (for Nitrogen).  Do not hesitate to read it
(feedback is appreciated).
* The target complexity on the normalized AST is cyclomatic complexity ---
the various informations displayed are mostly used to compute cyclomatic
complexity.
* Cyclomatic complexity is not computed on the source AST. It could be but
it is
not. It is usually easier to do analyses on the normalized AST but the more
fundamental
reason is stated below.
* Cyclomatic complexity is (or at least should be) the same between the
normalized and the source AST. In your example, it is indeed the case as
the or-condition creates a decision point. That is , there are 3 if
statements + one || expression = 4 decision points in the source AST and 4
if statements in the normalized AST. The cyclomatic complexities are thus
equal in this case, as they should be.

Just out of curiosity, what are the metrics you are interested in ?

Cheers,
-- 
Richard Bonichon
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.gforge.inria.fr/pipermail/frama-c-discuss/attachments/20120515/e76e9f23/attachment.html>