Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.McCabeChecker.html

changeset 4423
14f3ca3dcef6
equal deleted inserted replaced
4419:66be66ec3afc 4423:14f3ca3dcef6
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric6.Plugins.CheckerPlugins.CodeStyleChecker.McCabeChecker</title>
4 <meta charset="UTF-8">
5 <style>
6 body {
7 background: #EDECE6;
8 margin: 0em 1em 10em 1em;
9 color: black;
10 }
11
12 h1 { color: white; background: #85774A; }
13 h2 { color: white; background: #85774A; }
14 h3 { color: white; background: #9D936E; }
15 h4 { color: white; background: #9D936E; }
16
17 a { color: #BA6D36; }
18
19 </style>
20 </head>
21 <body><a NAME="top" ID="top"></a>
22 <h1>eric6.Plugins.CheckerPlugins.CodeStyleChecker.McCabeChecker</h1>
23 <p>
24 Module implementing a checker for code complexity.
25 </p>
26 <h3>Global Attributes</h3>
27 <table>
28 <tr><td>None</td></tr>
29 </table>
30 <h3>Classes</h3>
31 <table>
32 <tr>
33 <td><a href="#McCabeChecker">McCabeChecker</a></td>
34 <td>Class implementing a checker for code complexity iaw.</td>
35 </tr>
36 </table>
37 <h3>Functions</h3>
38 <table>
39 <tr><td>None</td></tr>
40 </table>
41 <hr /><hr />
42 <a NAME="McCabeChecker" ID="McCabeChecker"></a>
43 <h2>McCabeChecker</h2>
44 <p>
45 Class implementing a checker for code complexity iaw. McCabe.
46 </p>
47 <h3>Derived from</h3>
48 object
49 <h3>Class Attributes</h3>
50 <table>
51 <tr><td>Codes</td></tr>
52 </table>
53 <h3>Class Methods</h3>
54 <table>
55 <tr><td>None</td></tr>
56 </table>
57 <h3>Methods</h3>
58 <table>
59 <tr>
60 <td><a href="#McCabeChecker.__init__">McCabeChecker</a></td>
61 <td>Constructor</td>
62 </tr><tr>
63 <td><a href="#McCabeChecker.__error">__error</a></td>
64 <td>Private method to record an issue.</td>
65 </tr><tr>
66 <td><a href="#McCabeChecker.__ignoreCode">__ignoreCode</a></td>
67 <td>Private method to check if the error code should be ignored.</td>
68 </tr><tr>
69 <td><a href="#McCabeChecker.__reportInvalidSyntax">__reportInvalidSyntax</a></td>
70 <td>Private method to report a syntax error.</td>
71 </tr><tr>
72 <td><a href="#McCabeChecker.run">run</a></td>
73 <td>Public method to check the given source for code complexity.</td>
74 </tr>
75 </table>
76 <h3>Static Methods</h3>
77 <table>
78 <tr><td>None</td></tr>
79 </table>
80 <a NAME="McCabeChecker.__init__" ID="McCabeChecker.__init__"></a>
81 <h4>McCabeChecker (Constructor)</h4>
82 <b>McCabeChecker</b>(<i>source, filename, select, ignore, maxComplexity=10</i>)
83 <p>
84 Constructor
85 </p><dl>
86 <dt><i>source</i> (list of str)</dt>
87 <dd>
88 source code to be checked
89 </dd><dt><i>filename</i> (str)</dt>
90 <dd>
91 name of the source file
92 </dd><dt><i>select</i> (list of str)</dt>
93 <dd>
94 list of selected codes
95 </dd><dt><i>ignore</i> (list of str)</dt>
96 <dd>
97 list of codes to be ignored
98 </dd><dt><i>maxComplexity</i> (int)</dt>
99 <dd>
100 maximum allowed complexity value
101 </dd>
102 </dl><a NAME="McCabeChecker.__error" ID="McCabeChecker.__error"></a>
103 <h4>McCabeChecker.__error</h4>
104 <b>__error</b>(<i>lineNumber, offset, code, *args</i>)
105 <p>
106 Private method to record an issue.
107 </p><dl>
108 <dt><i>lineNumber</i> (int)</dt>
109 <dd>
110 line number of the issue
111 </dd><dt><i>offset</i> (int)</dt>
112 <dd>
113 position within line of the issue
114 </dd><dt><i>code</i> (str)</dt>
115 <dd>
116 message code
117 </dd><dt><i>args</i> (list)</dt>
118 <dd>
119 arguments for the message
120 </dd>
121 </dl><a NAME="McCabeChecker.__ignoreCode" ID="McCabeChecker.__ignoreCode"></a>
122 <h4>McCabeChecker.__ignoreCode</h4>
123 <b>__ignoreCode</b>(<i>code</i>)
124 <p>
125 Private method to check if the error code should be ignored.
126 </p><dl>
127 <dt><i>code</i></dt>
128 <dd>
129 message code to check for (string)
130 </dd>
131 </dl><dl>
132 <dt>Returns:</dt>
133 <dd>
134 flag indicating to ignore the given code (boolean)
135 </dd>
136 </dl><a NAME="McCabeChecker.__reportInvalidSyntax" ID="McCabeChecker.__reportInvalidSyntax"></a>
137 <h4>McCabeChecker.__reportInvalidSyntax</h4>
138 <b>__reportInvalidSyntax</b>(<i></i>)
139 <p>
140 Private method to report a syntax error.
141 </p><a NAME="McCabeChecker.run" ID="McCabeChecker.run"></a>
142 <h4>McCabeChecker.run</h4>
143 <b>run</b>(<i></i>)
144 <p>
145 Public method to check the given source for code complexity.
146 </p>
147 <div align="right"><a href="#top">Up</a></div>
148 <hr />
149 </body></html>

eric ide

mercurial