|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Complexity.mccabe</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> |
|
22 <a NAME="top" ID="top"></a> |
|
23 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Complexity.mccabe</h1> |
|
24 |
|
25 <h3>Global Attributes</h3> |
|
26 |
|
27 <table> |
|
28 <tr><td>__version__</td></tr> |
|
29 </table> |
|
30 <h3>Classes</h3> |
|
31 |
|
32 <table> |
|
33 |
|
34 <tr> |
|
35 <td><a href="#ASTVisitor">ASTVisitor</a></td> |
|
36 <td>Performs a depth-first walk of the AST.</td> |
|
37 </tr> |
|
38 <tr> |
|
39 <td><a href="#PathGraph">PathGraph</a></td> |
|
40 <td></td> |
|
41 </tr> |
|
42 <tr> |
|
43 <td><a href="#PathGraphingAstVisitor">PathGraphingAstVisitor</a></td> |
|
44 <td>A visitor for a parsed Abstract Syntax Tree which finds executable statements.</td> |
|
45 </tr> |
|
46 <tr> |
|
47 <td><a href="#PathNode">PathNode</a></td> |
|
48 <td></td> |
|
49 </tr> |
|
50 </table> |
|
51 <h3>Functions</h3> |
|
52 |
|
53 <table> |
|
54 <tr><td>None</td></tr> |
|
55 </table> |
|
56 <hr /> |
|
57 <hr /> |
|
58 <a NAME="ASTVisitor" ID="ASTVisitor"></a> |
|
59 <h2>ASTVisitor</h2> |
|
60 |
|
61 <p> |
|
62 Performs a depth-first walk of the AST. |
|
63 </p> |
|
64 <h3>Derived from</h3> |
|
65 object |
|
66 <h3>Class Attributes</h3> |
|
67 |
|
68 <table> |
|
69 <tr><td>None</td></tr> |
|
70 </table> |
|
71 <h3>Class Methods</h3> |
|
72 |
|
73 <table> |
|
74 <tr><td>None</td></tr> |
|
75 </table> |
|
76 <h3>Methods</h3> |
|
77 |
|
78 <table> |
|
79 |
|
80 <tr> |
|
81 <td><a href="#ASTVisitor.__init__">ASTVisitor</a></td> |
|
82 <td></td> |
|
83 </tr> |
|
84 <tr> |
|
85 <td><a href="#ASTVisitor.default">default</a></td> |
|
86 <td></td> |
|
87 </tr> |
|
88 <tr> |
|
89 <td><a href="#ASTVisitor.dispatch">dispatch</a></td> |
|
90 <td></td> |
|
91 </tr> |
|
92 <tr> |
|
93 <td><a href="#ASTVisitor.preorder">preorder</a></td> |
|
94 <td>Do preorder walk of tree using visitor</td> |
|
95 </tr> |
|
96 </table> |
|
97 <h3>Static Methods</h3> |
|
98 |
|
99 <table> |
|
100 <tr><td>None</td></tr> |
|
101 </table> |
|
102 |
|
103 <a NAME="ASTVisitor.__init__" ID="ASTVisitor.__init__"></a> |
|
104 <h4>ASTVisitor (Constructor)</h4> |
|
105 <b>ASTVisitor</b>(<i></i>) |
|
106 |
|
107 <a NAME="ASTVisitor.default" ID="ASTVisitor.default"></a> |
|
108 <h4>ASTVisitor.default</h4> |
|
109 <b>default</b>(<i>node, *args</i>) |
|
110 |
|
111 <a NAME="ASTVisitor.dispatch" ID="ASTVisitor.dispatch"></a> |
|
112 <h4>ASTVisitor.dispatch</h4> |
|
113 <b>dispatch</b>(<i>node, *args</i>) |
|
114 |
|
115 <a NAME="ASTVisitor.preorder" ID="ASTVisitor.preorder"></a> |
|
116 <h4>ASTVisitor.preorder</h4> |
|
117 <b>preorder</b>(<i>tree, visitor, *args</i>) |
|
118 |
|
119 <p> |
|
120 Do preorder walk of tree using visitor |
|
121 </p> |
|
122 <div align="right"><a href="#top">Up</a></div> |
|
123 <hr /> |
|
124 <hr /> |
|
125 <a NAME="PathGraph" ID="PathGraph"></a> |
|
126 <h2>PathGraph</h2> |
|
127 |
|
128 <h3>Derived from</h3> |
|
129 object |
|
130 <h3>Class Attributes</h3> |
|
131 |
|
132 <table> |
|
133 <tr><td>None</td></tr> |
|
134 </table> |
|
135 <h3>Class Methods</h3> |
|
136 |
|
137 <table> |
|
138 <tr><td>None</td></tr> |
|
139 </table> |
|
140 <h3>Methods</h3> |
|
141 |
|
142 <table> |
|
143 |
|
144 <tr> |
|
145 <td><a href="#PathGraph.__init__">PathGraph</a></td> |
|
146 <td></td> |
|
147 </tr> |
|
148 <tr> |
|
149 <td><a href="#PathGraph.complexity">complexity</a></td> |
|
150 <td>Return the McCabe complexity for the graph.</td> |
|
151 </tr> |
|
152 <tr> |
|
153 <td><a href="#PathGraph.connect">connect</a></td> |
|
154 <td></td> |
|
155 </tr> |
|
156 <tr> |
|
157 <td><a href="#PathGraph.to_dot">to_dot</a></td> |
|
158 <td></td> |
|
159 </tr> |
|
160 </table> |
|
161 <h3>Static Methods</h3> |
|
162 |
|
163 <table> |
|
164 <tr><td>None</td></tr> |
|
165 </table> |
|
166 |
|
167 <a NAME="PathGraph.__init__" ID="PathGraph.__init__"></a> |
|
168 <h4>PathGraph (Constructor)</h4> |
|
169 <b>PathGraph</b>(<i>name, entity, lineno, column=0</i>) |
|
170 |
|
171 <a NAME="PathGraph.complexity" ID="PathGraph.complexity"></a> |
|
172 <h4>PathGraph.complexity</h4> |
|
173 <b>complexity</b>(<i></i>) |
|
174 |
|
175 <p> |
|
176 Return the McCabe complexity for the graph. |
|
177 V-E+2 |
|
178 </p> |
|
179 <a NAME="PathGraph.connect" ID="PathGraph.connect"></a> |
|
180 <h4>PathGraph.connect</h4> |
|
181 <b>connect</b>(<i>n1, n2</i>) |
|
182 |
|
183 <a NAME="PathGraph.to_dot" ID="PathGraph.to_dot"></a> |
|
184 <h4>PathGraph.to_dot</h4> |
|
185 <b>to_dot</b>(<i></i>) |
|
186 |
|
187 <div align="right"><a href="#top">Up</a></div> |
|
188 <hr /> |
|
189 <hr /> |
|
190 <a NAME="PathGraphingAstVisitor" ID="PathGraphingAstVisitor"></a> |
|
191 <h2>PathGraphingAstVisitor</h2> |
|
192 |
|
193 <p> |
|
194 A visitor for a parsed Abstract Syntax Tree which finds executable |
|
195 statements. |
|
196 </p> |
|
197 <h3>Derived from</h3> |
|
198 ASTVisitor |
|
199 <h3>Class Attributes</h3> |
|
200 |
|
201 <table> |
|
202 <tr><td>visitAsyncFor</td></tr><tr><td>visitAsyncFunctionDef</td></tr><tr><td>visitAsyncWith</td></tr><tr><td>visitTry</td></tr> |
|
203 </table> |
|
204 <h3>Class Methods</h3> |
|
205 |
|
206 <table> |
|
207 <tr><td>None</td></tr> |
|
208 </table> |
|
209 <h3>Methods</h3> |
|
210 |
|
211 <table> |
|
212 |
|
213 <tr> |
|
214 <td><a href="#PathGraphingAstVisitor.__init__">PathGraphingAstVisitor</a></td> |
|
215 <td></td> |
|
216 </tr> |
|
217 <tr> |
|
218 <td><a href="#PathGraphingAstVisitor._subgraph">_subgraph</a></td> |
|
219 <td>create the subgraphs representing any `if` and `for` statements</td> |
|
220 </tr> |
|
221 <tr> |
|
222 <td><a href="#PathGraphingAstVisitor._subgraph_parse">_subgraph_parse</a></td> |
|
223 <td>parse the body and any `else` block of `if` and `for` statements</td> |
|
224 </tr> |
|
225 <tr> |
|
226 <td><a href="#PathGraphingAstVisitor.appendPathNode">appendPathNode</a></td> |
|
227 <td></td> |
|
228 </tr> |
|
229 <tr> |
|
230 <td><a href="#PathGraphingAstVisitor.default">default</a></td> |
|
231 <td></td> |
|
232 </tr> |
|
233 <tr> |
|
234 <td><a href="#PathGraphingAstVisitor.dispatch_list">dispatch_list</a></td> |
|
235 <td></td> |
|
236 </tr> |
|
237 <tr> |
|
238 <td><a href="#PathGraphingAstVisitor.reset">reset</a></td> |
|
239 <td></td> |
|
240 </tr> |
|
241 <tr> |
|
242 <td><a href="#PathGraphingAstVisitor.visitClassDef">visitClassDef</a></td> |
|
243 <td></td> |
|
244 </tr> |
|
245 <tr> |
|
246 <td><a href="#PathGraphingAstVisitor.visitFunctionDef">visitFunctionDef</a></td> |
|
247 <td></td> |
|
248 </tr> |
|
249 <tr> |
|
250 <td><a href="#PathGraphingAstVisitor.visitIf">visitIf</a></td> |
|
251 <td></td> |
|
252 </tr> |
|
253 <tr> |
|
254 <td><a href="#PathGraphingAstVisitor.visitLoop">visitLoop</a></td> |
|
255 <td></td> |
|
256 </tr> |
|
257 <tr> |
|
258 <td><a href="#PathGraphingAstVisitor.visitSimpleStatement">visitSimpleStatement</a></td> |
|
259 <td></td> |
|
260 </tr> |
|
261 <tr> |
|
262 <td><a href="#PathGraphingAstVisitor.visitTryExcept">visitTryExcept</a></td> |
|
263 <td></td> |
|
264 </tr> |
|
265 <tr> |
|
266 <td><a href="#PathGraphingAstVisitor.visitWith">visitWith</a></td> |
|
267 <td></td> |
|
268 </tr> |
|
269 </table> |
|
270 <h3>Static Methods</h3> |
|
271 |
|
272 <table> |
|
273 <tr><td>None</td></tr> |
|
274 </table> |
|
275 |
|
276 <a NAME="PathGraphingAstVisitor.__init__" ID="PathGraphingAstVisitor.__init__"></a> |
|
277 <h4>PathGraphingAstVisitor (Constructor)</h4> |
|
278 <b>PathGraphingAstVisitor</b>(<i></i>) |
|
279 |
|
280 <a NAME="PathGraphingAstVisitor._subgraph" ID="PathGraphingAstVisitor._subgraph"></a> |
|
281 <h4>PathGraphingAstVisitor._subgraph</h4> |
|
282 <b>_subgraph</b>(<i>node, name, extra_blocks=()</i>) |
|
283 |
|
284 <p> |
|
285 create the subgraphs representing any `if` and `for` statements |
|
286 </p> |
|
287 <a NAME="PathGraphingAstVisitor._subgraph_parse" ID="PathGraphingAstVisitor._subgraph_parse"></a> |
|
288 <h4>PathGraphingAstVisitor._subgraph_parse</h4> |
|
289 <b>_subgraph_parse</b>(<i>node, pathnode, extra_blocks</i>) |
|
290 |
|
291 <p> |
|
292 parse the body and any `else` block of `if` and `for` statements |
|
293 </p> |
|
294 <a NAME="PathGraphingAstVisitor.appendPathNode" ID="PathGraphingAstVisitor.appendPathNode"></a> |
|
295 <h4>PathGraphingAstVisitor.appendPathNode</h4> |
|
296 <b>appendPathNode</b>(<i>name</i>) |
|
297 |
|
298 <a NAME="PathGraphingAstVisitor.default" ID="PathGraphingAstVisitor.default"></a> |
|
299 <h4>PathGraphingAstVisitor.default</h4> |
|
300 <b>default</b>(<i>node, *args</i>) |
|
301 |
|
302 <a NAME="PathGraphingAstVisitor.dispatch_list" ID="PathGraphingAstVisitor.dispatch_list"></a> |
|
303 <h4>PathGraphingAstVisitor.dispatch_list</h4> |
|
304 <b>dispatch_list</b>(<i>node_list</i>) |
|
305 |
|
306 <a NAME="PathGraphingAstVisitor.reset" ID="PathGraphingAstVisitor.reset"></a> |
|
307 <h4>PathGraphingAstVisitor.reset</h4> |
|
308 <b>reset</b>(<i></i>) |
|
309 |
|
310 <a NAME="PathGraphingAstVisitor.visitClassDef" ID="PathGraphingAstVisitor.visitClassDef"></a> |
|
311 <h4>PathGraphingAstVisitor.visitClassDef</h4> |
|
312 <b>visitClassDef</b>(<i>node</i>) |
|
313 |
|
314 <a NAME="PathGraphingAstVisitor.visitFunctionDef" ID="PathGraphingAstVisitor.visitFunctionDef"></a> |
|
315 <h4>PathGraphingAstVisitor.visitFunctionDef</h4> |
|
316 <b>visitFunctionDef</b>(<i>node</i>) |
|
317 |
|
318 <a NAME="PathGraphingAstVisitor.visitIf" ID="PathGraphingAstVisitor.visitIf"></a> |
|
319 <h4>PathGraphingAstVisitor.visitIf</h4> |
|
320 <b>visitIf</b>(<i>node</i>) |
|
321 |
|
322 <a NAME="PathGraphingAstVisitor.visitLoop" ID="PathGraphingAstVisitor.visitLoop"></a> |
|
323 <h4>PathGraphingAstVisitor.visitLoop</h4> |
|
324 <b>visitLoop</b>(<i>node</i>) |
|
325 |
|
326 <a NAME="PathGraphingAstVisitor.visitSimpleStatement" ID="PathGraphingAstVisitor.visitSimpleStatement"></a> |
|
327 <h4>PathGraphingAstVisitor.visitSimpleStatement</h4> |
|
328 <b>visitSimpleStatement</b>(<i>node</i>) |
|
329 |
|
330 <a NAME="PathGraphingAstVisitor.visitTryExcept" ID="PathGraphingAstVisitor.visitTryExcept"></a> |
|
331 <h4>PathGraphingAstVisitor.visitTryExcept</h4> |
|
332 <b>visitTryExcept</b>(<i>node</i>) |
|
333 |
|
334 <a NAME="PathGraphingAstVisitor.visitWith" ID="PathGraphingAstVisitor.visitWith"></a> |
|
335 <h4>PathGraphingAstVisitor.visitWith</h4> |
|
336 <b>visitWith</b>(<i>node</i>) |
|
337 |
|
338 <div align="right"><a href="#top">Up</a></div> |
|
339 <hr /> |
|
340 <hr /> |
|
341 <a NAME="PathNode" ID="PathNode"></a> |
|
342 <h2>PathNode</h2> |
|
343 |
|
344 <h3>Derived from</h3> |
|
345 object |
|
346 <h3>Class Attributes</h3> |
|
347 |
|
348 <table> |
|
349 <tr><td>None</td></tr> |
|
350 </table> |
|
351 <h3>Class Methods</h3> |
|
352 |
|
353 <table> |
|
354 <tr><td>None</td></tr> |
|
355 </table> |
|
356 <h3>Methods</h3> |
|
357 |
|
358 <table> |
|
359 |
|
360 <tr> |
|
361 <td><a href="#PathNode.__init__">PathNode</a></td> |
|
362 <td></td> |
|
363 </tr> |
|
364 <tr> |
|
365 <td><a href="#PathNode.dot_id">dot_id</a></td> |
|
366 <td></td> |
|
367 </tr> |
|
368 <tr> |
|
369 <td><a href="#PathNode.to_dot">to_dot</a></td> |
|
370 <td></td> |
|
371 </tr> |
|
372 </table> |
|
373 <h3>Static Methods</h3> |
|
374 |
|
375 <table> |
|
376 <tr><td>None</td></tr> |
|
377 </table> |
|
378 |
|
379 <a NAME="PathNode.__init__" ID="PathNode.__init__"></a> |
|
380 <h4>PathNode (Constructor)</h4> |
|
381 <b>PathNode</b>(<i>name, look="circle"</i>) |
|
382 |
|
383 <a NAME="PathNode.dot_id" ID="PathNode.dot_id"></a> |
|
384 <h4>PathNode.dot_id</h4> |
|
385 <b>dot_id</b>(<i></i>) |
|
386 |
|
387 <a NAME="PathNode.to_dot" ID="PathNode.to_dot"></a> |
|
388 <h4>PathNode.to_dot</h4> |
|
389 <b>to_dot</b>(<i></i>) |
|
390 |
|
391 <div align="right"><a href="#top">Up</a></div> |
|
392 <hr /> |
|
393 </body></html> |