<html><head>
<title> Standards HTML </title>
</head><body bgcolor="#fffff2">
<a name="title_comp"></a>
<CENTER>
<br>
<img src="ldra5.gif">
<br>
<br><center><img src="break.gif"></center><br><br>
<CENTER><img src="title_comp.gif"></CENTER>
<center><br>
<br><font color="purple">
[ Main Static Analysis Standards <a href="standards40.html#title_static_40">1 - 40</a> | <a href="standards80.html#title_static_80">41 - 80</a> | <a href="standards120.html#title_static_120">81 - 120</a> | <a href="standards160.html#title_static_160">121 - 160</a> | <a href="standards200.html#title_static_200">161 - 200</a> | <a href="standards240.html#title_static_240">201 - </a> ]<br>
[ <a href="standard.html#title_comp">Complex Analysis Standards</a> | <a href="standard.html#title_data">Static Data Flow Analysis Standards</a> | <a href="standard.html#title_cross">Cross Reference Standards</a> ]<br>
[ <a href="standard.html#title_qual">Quality Report Standards</a> | <a href="standard.html#title_info">Information Flow Standards</a> ]<br>
[ MISRA Standards <a href="misra40.html#title_misra_40">1 - 40</a> | <a href="misra80.html#title_misra_80">41 - 80</a> | <a href="misra120.html#title_misra_120">80 - 127</a> ]
</center>
<br>
<br>
<table cellpadding="0" cellspacing="0" border="0">
<tr>
<td width=10%>
</td>
<td width=10% valign="top">
<b>
</b>
</td>
<td width=4%>
</td>
<td width=60% align=left valign="top" >
<b><font color="#A95B5B">
</b><font color="#C08888">
<font size=2>
<table>
<tr>
<td width=5%>
</td>
<td>
<font face="Courier" size="1">
</td>
</tr>
</table>
</td>
<td width=35%>
</td>
</tr>
</td>
</tr>
<tr>
<td colspan=5>
<br>
</td>
</tr>
<tr>
<td>
<br><br>
</td>
<td valign="top">
<b><a name="1_C"></a><font color="#A95B5B">
1 <img src="dot_clr.gif" width="5" height="1">C
</b><br><br>
</td>
<td>
</td>
<td align=left valign="top">
<b><font color="#A95B5B">
Cyclomatic complexity greater than ***.
</b><br><br>
<font color="#C08888">
This is similar to n lines of code. It is used to limit the size (and hence complexity) of procedures.
The *** symbols refer to a user definable number for this standard. The configuration is made in the <lang>pen.dat file.
<br><br>Example:
<br>
<font size=2>
<br>
<table>
<tr>
<td width=5%>
</td>
<td>
<pre>
<pre><font face="Courier" size="1">#include "C_STANDARDS.H"
BOOL isHexDigit( CHAR Hex );
<font color="green">/********************************************************
* Complexity Analysis 1 C : Cyclomatic Complexity greater than ***
********************************************************/</font>
BOOL isHexDigit( CHAR Hex )
{
BOOL bResult;
bResult = FALSE;
if ((Hex == '0') || (Hex == '1') || (Hex == '2') || (Hex == '3') ||
(Hex == '4') || (Hex == '5') || (Hex == '6') || (Hex == '7') ||
(Hex == '8') || (Hex == '9') || (Hex == 'A') || (Hex == 'a') ||
(Hex == 'B') || (Hex == 'b') || (Hex == 'C') || (Hex == 'c') ||
(Hex == 'D') || (Hex == 'd') || (Hex == 'E') || (Hex == 'e') ||
(Hex == 'F') || (Hex == 'f'))
{
bResult = TRUE;
}
return bResult;
}
<font color="green">/*
* Copyright (c) 2001 Liverpool Data Research Associates
*
* This penalty is reported as follows:
*
* Report Active Location
*
* Annotated Source Code Yes Procedure Footer
* Source Code & Violations Yes Procedure Footer
* Reformatted Code Yes Procedure Footer
* Individual Quality Report Yes
*
*/</font></pre>
</td></tr></table>
</td>
</tr>
<tr>
<td colspan=5>
<br>
<center><img src="break.gif"></center><br>
<br>
</td>
</tr>
<tr>
<td>
</td>
<td valign="top">
<b><a name="2_C"></a><font color="#A95B5B">
2 <img src="dot_clr.gif" width="5" height="1">C
</b><br><br>
</td>
<td>
</td>
<td align=left valign="top">
<b><font color="#A95B5B">
Procedure is not reducible in terms of intervals.
</b><br><br><font color="#C08888">
Reducibility in terms of interval analysis essentially means that the procedure is not a sequence of cleanly nested loops.
<table>
<tr>
<td width=5%>
</td>
<td>
</td></tr></table>
</td>
</tr>
<tr>
<td colspan=5>
<br>
<center><img src="break.gif"></center><br>
<br>
</td>
</tr>
<tr>
<td>
<br><br>
</td>
<td valign="top">
<b><a name="3_C"></a><font color="#A95B5B">
3 <img src="dot_clr.gif" width="5" height="1">C
</b><br><br>
</td>
<td>
</td>
<td align=left valign="top">
<b><font color="#A95B5B">
Procedure contains essential knots.
</b><br><br><font color="#C08888">
This means that the code is poorly structured and reordering the constructs might produce an improvement.
<table>
<tr>
<td width=5%>
</td>
<td>
</td></tr></table>
</td>
</tr>
<tr>
<td colspan=5>
<br>
<center><img src="break.gif"></center><br>
<br>
</td>
</tr>
<tr>
<td>
<br><br>
</td>
<td valign="top">
<b><a name="4_S"></a><font color="#A95B5B">
4 <img src="dot_clr.gif" width="5" height="1">C
</b><br><br>
</td>
<td>
</td>
<td align=left valign="top">
<b><font color="#A95B5B">
Procedure is not structured.
</b><br><br><font color="#C08888">
This follows from the structured programming templates supplied.
<table>
<tr>
<td width=5%>
</td>
<td>
</td></tr></table>
</td>
</tr>
<tr>
<td colspan=5>
<br>
<center><img src="break.gif"></center><br>
<br>
</td>
</tr>
<tr>
<td>
<br><br>
</td>
<td valign="top">
<b><a name="5_C"></a><font color="#A95B5B">
5 <img src="dot_clr.gif" width="5" height="1">C
</b><br><br>
</td>
<td>
</td>
<td align=left valign="top">
<b><font color="#A95B5B">
Procedure contains infinite loop. DERA 142
</b><br><br><font color="#C08888">
This is another type of infinite loop. It arises from a control flow loop that has no exit mechanism of any type, e.g.:
l: goto l;
<table>
<tr>
<td width=5%>
</td>
<td>
</td></tr></table>
</td>
</tr>
<tr>
<td colspan=5>
<br>
<center><img src="break.gif"></center><br>
<br>
</td>
</tr>
<tr>
<td>
<br><br>
</td>
<td valign="top">
<b><a name="6_C"></a><font color="#A95B5B">
6 <img src="dot_clr.gif" width="5" height="1">C
</b><br><br>
</td>
<td>
</td>
<td align=left valign="top">
<b><font color="#A95B5B">
Procedure has more than one entry point.
</b><br><br><font color="#C08888">
This involves the use of entry statements which is compiler dependent.
<table>
<tr>
<td width=5%>
</td>
<td>
</td></tr></table>
</td>
</tr>
<tr>
<td colspan=5>
<br>
<center><img src="break.gif"></center><br>
<br>
</td>
</tr>
<tr>
<td>
<br><br>
</td>
<td valign="top">
<b><a name="7_C"></a><font color="#A95B5B">
7 <img src="dot_clr.gif" width="5" height="1">C
</b><br><br>
</td>
<td>
</td>
<td align=left valign="top">
<b><font color="#A95B5B">
Procedure has more
- 1
- 2
前往页