TICS Coding Standard Viewer 
TIOBE Software Quality Framework
Print-friendly version
©TIOBE Software www.tiobe.com
TIOBE - C Coding Standard

SR:  13#1Checked automatically with code checker

This rule is Obsolete
Synopsis:Functions shall be restricted to have a maximum decision count prescribed in the appropriate compliance table as measured by a recommended tool unless there is specific sign-off according to local procedures to the effect that this does not prejudice the reliability of the code and does not inhibit satisfactory test coverage.
Severity Level:5


A large body of evidence exists to suggest that restriction of complexity leads to more maintainable and reliable code, for example, (McCabe, 1976), (Nejmeh, 1988), (Hatton & Hopkins, 1989) and (Fenton, 1991). The problem is to define acceptable measures of complexity. The above measures are based on population studies of C and functional components with larger values than these will lie in the bottom 10-20% of C code from a wide variety of environments. These measures may change in future following population analysis of existing PMS code to set trigger points appropriate to PMS development.The number of decisions is an obvious metric and includes decisions from if, switch, for and while statements.

Note that the true path count through a function obeys the inequality: Number of decisions + 1 <= true path count <= static path count