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