src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Complexity.mccabe.html

branch
eric7
changeset 10479
856476537696
parent 9209
b99e7fd55fd3
equal deleted inserted replaced
10478:de9106c55c3d 10479:856476537696
7 <body> 7 <body>
8 <a NAME="top" ID="top"></a> 8 <a NAME="top" ID="top"></a>
9 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Complexity.mccabe</h1> 9 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Complexity.mccabe</h1>
10 10
11 <h3>Global Attributes</h3> 11 <h3>Global Attributes</h3>
12
13 <table> 12 <table>
14 <tr><td>__version__</td></tr> 13 <tr><td>__version__</td></tr>
15 </table> 14 </table>
15
16 <h3>Classes</h3> 16 <h3>Classes</h3>
17 17 <table>
18 <table>
19
20 <tr> 18 <tr>
21 <td><a href="#ASTVisitor">ASTVisitor</a></td> 19 <td><a href="#ASTVisitor">ASTVisitor</a></td>
22 <td>Performs a depth-first walk of the AST.</td> 20 <td>Performs a depth-first walk of the AST.</td>
23 </tr> 21 </tr>
24 <tr> 22 <tr>
32 <tr> 30 <tr>
33 <td><a href="#PathNode">PathNode</a></td> 31 <td><a href="#PathNode">PathNode</a></td>
34 <td></td> 32 <td></td>
35 </tr> 33 </tr>
36 </table> 34 </table>
35
37 <h3>Functions</h3> 36 <h3>Functions</h3>
38 37 <table>
39 <table> 38 <tr><td>None</td></tr>
40 <tr><td>None</td></tr> 39 </table>
41 </table> 40
42 <hr /> 41 <hr />
43 <hr /> 42 <hr />
44 <a NAME="ASTVisitor" ID="ASTVisitor"></a> 43 <a NAME="ASTVisitor" ID="ASTVisitor"></a>
45 <h2>ASTVisitor</h2> 44 <h2>ASTVisitor</h2>
46
47 <p> 45 <p>
48 Performs a depth-first walk of the AST. 46 Performs a depth-first walk of the AST.
49 </p> 47 </p>
48
50 <h3>Derived from</h3> 49 <h3>Derived from</h3>
51 object 50 object
52 <h3>Class Attributes</h3> 51 <h3>Class Attributes</h3>
53 52 <table>
54 <table> 53 <tr><td>None</td></tr>
55 <tr><td>None</td></tr> 54 </table>
56 </table> 55
57 <h3>Class Methods</h3> 56 <h3>Class Methods</h3>
58 57 <table>
59 <table> 58 <tr><td>None</td></tr>
60 <tr><td>None</td></tr> 59 </table>
61 </table> 60
62 <h3>Methods</h3> 61 <h3>Methods</h3>
63 62 <table>
64 <table>
65
66 <tr> 63 <tr>
67 <td><a href="#ASTVisitor.__init__">ASTVisitor</a></td> 64 <td><a href="#ASTVisitor.__init__">ASTVisitor</a></td>
68 <td></td> 65 <td></td>
69 </tr> 66 </tr>
70 <tr> 67 <tr>
78 <tr> 75 <tr>
79 <td><a href="#ASTVisitor.preorder">preorder</a></td> 76 <td><a href="#ASTVisitor.preorder">preorder</a></td>
80 <td>Do preorder walk of tree using visitor</td> 77 <td>Do preorder walk of tree using visitor</td>
81 </tr> 78 </tr>
82 </table> 79 </table>
80
83 <h3>Static Methods</h3> 81 <h3>Static Methods</h3>
84 82 <table>
85 <table> 83 <tr><td>None</td></tr>
86 <tr><td>None</td></tr> 84 </table>
87 </table> 85
88 86
89 <a NAME="ASTVisitor.__init__" ID="ASTVisitor.__init__"></a> 87 <a NAME="ASTVisitor.__init__" ID="ASTVisitor.__init__"></a>
90 <h4>ASTVisitor (Constructor)</h4> 88 <h4>ASTVisitor (Constructor)</h4>
91 <b>ASTVisitor</b>(<i></i>) 89 <b>ASTVisitor</b>(<i></i>)
92 90
99 <b>dispatch</b>(<i>node, *args</i>) 97 <b>dispatch</b>(<i>node, *args</i>)
100 98
101 <a NAME="ASTVisitor.preorder" ID="ASTVisitor.preorder"></a> 99 <a NAME="ASTVisitor.preorder" ID="ASTVisitor.preorder"></a>
102 <h4>ASTVisitor.preorder</h4> 100 <h4>ASTVisitor.preorder</h4>
103 <b>preorder</b>(<i>tree, visitor, *args</i>) 101 <b>preorder</b>(<i>tree, visitor, *args</i>)
104
105 <p> 102 <p>
106 Do preorder walk of tree using visitor 103 Do preorder walk of tree using visitor
107 </p> 104 </p>
105
108 <div align="right"><a href="#top">Up</a></div> 106 <div align="right"><a href="#top">Up</a></div>
109 <hr /> 107 <hr />
110 <hr /> 108 <hr />
111 <a NAME="PathGraph" ID="PathGraph"></a> 109 <a NAME="PathGraph" ID="PathGraph"></a>
112 <h2>PathGraph</h2> 110 <h2>PathGraph</h2>
113 111
114 <h3>Derived from</h3> 112 <h3>Derived from</h3>
115 object 113 object
116 <h3>Class Attributes</h3> 114 <h3>Class Attributes</h3>
117 115 <table>
118 <table> 116 <tr><td>None</td></tr>
119 <tr><td>None</td></tr> 117 </table>
120 </table> 118
121 <h3>Class Methods</h3> 119 <h3>Class Methods</h3>
122 120 <table>
123 <table> 121 <tr><td>None</td></tr>
124 <tr><td>None</td></tr> 122 </table>
125 </table> 123
126 <h3>Methods</h3> 124 <h3>Methods</h3>
127 125 <table>
128 <table>
129
130 <tr> 126 <tr>
131 <td><a href="#PathGraph.__init__">PathGraph</a></td> 127 <td><a href="#PathGraph.__init__">PathGraph</a></td>
132 <td></td> 128 <td></td>
133 </tr> 129 </tr>
134 <tr> 130 <tr>
142 <tr> 138 <tr>
143 <td><a href="#PathGraph.to_dot">to_dot</a></td> 139 <td><a href="#PathGraph.to_dot">to_dot</a></td>
144 <td></td> 140 <td></td>
145 </tr> 141 </tr>
146 </table> 142 </table>
143
147 <h3>Static Methods</h3> 144 <h3>Static Methods</h3>
148 145 <table>
149 <table> 146 <tr><td>None</td></tr>
150 <tr><td>None</td></tr> 147 </table>
151 </table> 148
152 149
153 <a NAME="PathGraph.__init__" ID="PathGraph.__init__"></a> 150 <a NAME="PathGraph.__init__" ID="PathGraph.__init__"></a>
154 <h4>PathGraph (Constructor)</h4> 151 <h4>PathGraph (Constructor)</h4>
155 <b>PathGraph</b>(<i>name, entity, lineno, column=0</i>) 152 <b>PathGraph</b>(<i>name, entity, lineno, column=0</i>)
156 153
157 <a NAME="PathGraph.complexity" ID="PathGraph.complexity"></a> 154 <a NAME="PathGraph.complexity" ID="PathGraph.complexity"></a>
158 <h4>PathGraph.complexity</h4> 155 <h4>PathGraph.complexity</h4>
159 <b>complexity</b>(<i></i>) 156 <b>complexity</b>(<i></i>)
160
161 <p> 157 <p>
162 Return the McCabe complexity for the graph. 158 Return the McCabe complexity for the graph.
163 V-E+2 159 V-E+2
164 </p> 160 </p>
161
165 <a NAME="PathGraph.connect" ID="PathGraph.connect"></a> 162 <a NAME="PathGraph.connect" ID="PathGraph.connect"></a>
166 <h4>PathGraph.connect</h4> 163 <h4>PathGraph.connect</h4>
167 <b>connect</b>(<i>n1, n2</i>) 164 <b>connect</b>(<i>n1, n2</i>)
168 165
169 <a NAME="PathGraph.to_dot" ID="PathGraph.to_dot"></a> 166 <a NAME="PathGraph.to_dot" ID="PathGraph.to_dot"></a>
173 <div align="right"><a href="#top">Up</a></div> 170 <div align="right"><a href="#top">Up</a></div>
174 <hr /> 171 <hr />
175 <hr /> 172 <hr />
176 <a NAME="PathGraphingAstVisitor" ID="PathGraphingAstVisitor"></a> 173 <a NAME="PathGraphingAstVisitor" ID="PathGraphingAstVisitor"></a>
177 <h2>PathGraphingAstVisitor</h2> 174 <h2>PathGraphingAstVisitor</h2>
178
179 <p> 175 <p>
180 A visitor for a parsed Abstract Syntax Tree which finds executable 176 A visitor for a parsed Abstract Syntax Tree which finds executable
181 statements. 177 statements.
182 </p> 178 </p>
179
183 <h3>Derived from</h3> 180 <h3>Derived from</h3>
184 ASTVisitor 181 ASTVisitor
185 <h3>Class Attributes</h3> 182 <h3>Class Attributes</h3>
186 183 <table>
187 <table> 184 <tr><td>visitAsyncFor</td></tr>
188 <tr><td>visitAsyncFor</td></tr><tr><td>visitAsyncFunctionDef</td></tr><tr><td>visitAsyncWith</td></tr><tr><td>visitTry</td></tr> 185 <tr><td>visitAsyncFunctionDef</td></tr>
189 </table> 186 <tr><td>visitAsyncWith</td></tr>
187 <tr><td>visitTry</td></tr>
188 </table>
189
190 <h3>Class Methods</h3> 190 <h3>Class Methods</h3>
191 191 <table>
192 <table> 192 <tr><td>None</td></tr>
193 <tr><td>None</td></tr> 193 </table>
194 </table> 194
195 <h3>Methods</h3> 195 <h3>Methods</h3>
196 196 <table>
197 <table>
198
199 <tr> 197 <tr>
200 <td><a href="#PathGraphingAstVisitor.__init__">PathGraphingAstVisitor</a></td> 198 <td><a href="#PathGraphingAstVisitor.__init__">PathGraphingAstVisitor</a></td>
201 <td></td> 199 <td></td>
202 </tr> 200 </tr>
203 <tr> 201 <tr>
251 <tr> 249 <tr>
252 <td><a href="#PathGraphingAstVisitor.visitWith">visitWith</a></td> 250 <td><a href="#PathGraphingAstVisitor.visitWith">visitWith</a></td>
253 <td></td> 251 <td></td>
254 </tr> 252 </tr>
255 </table> 253 </table>
254
256 <h3>Static Methods</h3> 255 <h3>Static Methods</h3>
257 256 <table>
258 <table> 257 <tr><td>None</td></tr>
259 <tr><td>None</td></tr> 258 </table>
260 </table> 259
261 260
262 <a NAME="PathGraphingAstVisitor.__init__" ID="PathGraphingAstVisitor.__init__"></a> 261 <a NAME="PathGraphingAstVisitor.__init__" ID="PathGraphingAstVisitor.__init__"></a>
263 <h4>PathGraphingAstVisitor (Constructor)</h4> 262 <h4>PathGraphingAstVisitor (Constructor)</h4>
264 <b>PathGraphingAstVisitor</b>(<i></i>) 263 <b>PathGraphingAstVisitor</b>(<i></i>)
265 264
266 <a NAME="PathGraphingAstVisitor._subgraph" ID="PathGraphingAstVisitor._subgraph"></a> 265 <a NAME="PathGraphingAstVisitor._subgraph" ID="PathGraphingAstVisitor._subgraph"></a>
267 <h4>PathGraphingAstVisitor._subgraph</h4> 266 <h4>PathGraphingAstVisitor._subgraph</h4>
268 <b>_subgraph</b>(<i>node, name, extra_blocks=()</i>) 267 <b>_subgraph</b>(<i>node, name, extra_blocks=()</i>)
269
270 <p> 268 <p>
271 create the subgraphs representing any `if` and `for` statements 269 create the subgraphs representing any `if` and `for` statements
272 </p> 270 </p>
271
273 <a NAME="PathGraphingAstVisitor._subgraph_parse" ID="PathGraphingAstVisitor._subgraph_parse"></a> 272 <a NAME="PathGraphingAstVisitor._subgraph_parse" ID="PathGraphingAstVisitor._subgraph_parse"></a>
274 <h4>PathGraphingAstVisitor._subgraph_parse</h4> 273 <h4>PathGraphingAstVisitor._subgraph_parse</h4>
275 <b>_subgraph_parse</b>(<i>node, pathnode, extra_blocks</i>) 274 <b>_subgraph_parse</b>(<i>node, pathnode, extra_blocks</i>)
276
277 <p> 275 <p>
278 parse the body and any `else` block of `if` and `for` statements 276 parse the body and any `else` block of `if` and `for` statements
279 </p> 277 </p>
278
280 <a NAME="PathGraphingAstVisitor.appendPathNode" ID="PathGraphingAstVisitor.appendPathNode"></a> 279 <a NAME="PathGraphingAstVisitor.appendPathNode" ID="PathGraphingAstVisitor.appendPathNode"></a>
281 <h4>PathGraphingAstVisitor.appendPathNode</h4> 280 <h4>PathGraphingAstVisitor.appendPathNode</h4>
282 <b>appendPathNode</b>(<i>name</i>) 281 <b>appendPathNode</b>(<i>name</i>)
283 282
284 <a NAME="PathGraphingAstVisitor.default" ID="PathGraphingAstVisitor.default"></a> 283 <a NAME="PathGraphingAstVisitor.default" ID="PathGraphingAstVisitor.default"></a>
328 <h2>PathNode</h2> 327 <h2>PathNode</h2>
329 328
330 <h3>Derived from</h3> 329 <h3>Derived from</h3>
331 object 330 object
332 <h3>Class Attributes</h3> 331 <h3>Class Attributes</h3>
333 332 <table>
334 <table> 333 <tr><td>None</td></tr>
335 <tr><td>None</td></tr> 334 </table>
336 </table> 335
337 <h3>Class Methods</h3> 336 <h3>Class Methods</h3>
338 337 <table>
339 <table> 338 <tr><td>None</td></tr>
340 <tr><td>None</td></tr> 339 </table>
341 </table> 340
342 <h3>Methods</h3> 341 <h3>Methods</h3>
343 342 <table>
344 <table>
345
346 <tr> 343 <tr>
347 <td><a href="#PathNode.__init__">PathNode</a></td> 344 <td><a href="#PathNode.__init__">PathNode</a></td>
348 <td></td> 345 <td></td>
349 </tr> 346 </tr>
350 <tr> 347 <tr>
354 <tr> 351 <tr>
355 <td><a href="#PathNode.to_dot">to_dot</a></td> 352 <td><a href="#PathNode.to_dot">to_dot</a></td>
356 <td></td> 353 <td></td>
357 </tr> 354 </tr>
358 </table> 355 </table>
356
359 <h3>Static Methods</h3> 357 <h3>Static Methods</h3>
360 358 <table>
361 <table> 359 <tr><td>None</td></tr>
362 <tr><td>None</td></tr> 360 </table>
363 </table> 361
364 362
365 <a NAME="PathNode.__init__" ID="PathNode.__init__"></a> 363 <a NAME="PathNode.__init__" ID="PathNode.__init__"></a>
366 <h4>PathNode (Constructor)</h4> 364 <h4>PathNode (Constructor)</h4>
367 <b>PathNode</b>(<i>name, look="circle"</i>) 365 <b>PathNode</b>(<i>name, look="circle"</i>)
368 366

eric ide

mercurial