src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Unused.UnusedChecker.html

branch
eric7
changeset 10479
856476537696
parent 10070
9f5758c0fec1
child 11150
73d80859079c
equal deleted inserted replaced
10478:de9106c55c3d 10479:856476537696
5 <link rel="stylesheet" href="styles.css"> 5 <link rel="stylesheet" href="styles.css">
6 </head> 6 </head>
7 <body> 7 <body>
8 <a NAME="top" ID="top"></a> 8 <a NAME="top" ID="top"></a>
9 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Unused.UnusedChecker</h1> 9 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Unused.UnusedChecker</h1>
10
11 <p> 10 <p>
12 Module implementing a checker for unused arguments, variables, ... . 11 Module implementing a checker for unused arguments, variables, ... .
13 </p> 12 </p>
13
14 <h3>Global Attributes</h3> 14 <h3>Global Attributes</h3>
15
16 <table> 15 <table>
17 <tr><td>GlobalVariableStoreInfo</td></tr> 16 <tr><td>GlobalVariableStoreInfo</td></tr>
18 </table> 17 </table>
18
19 <h3>Classes</h3> 19 <h3>Classes</h3>
20 20 <table>
21 <table>
22
23 <tr> 21 <tr>
24 <td><a href="#FunctionFinder">FunctionFinder</a></td> 22 <td><a href="#FunctionFinder">FunctionFinder</a></td>
25 <td>Class to find all defined functions and methods.</td> 23 <td>Class to find all defined functions and methods.</td>
26 </tr> 24 </tr>
27 <tr> 25 <tr>
35 <tr> 33 <tr>
36 <td><a href="#UnusedChecker">UnusedChecker</a></td> 34 <td><a href="#UnusedChecker">UnusedChecker</a></td>
37 <td>Class implementing a checker for unused arguments, variables, ...</td> 35 <td>Class implementing a checker for unused arguments, variables, ...</td>
38 </tr> 36 </tr>
39 </table> 37 </table>
38
40 <h3>Functions</h3> 39 <h3>Functions</h3>
41 40 <table>
42 <table> 41 <tr><td>None</td></tr>
43 <tr><td>None</td></tr> 42 </table>
44 </table> 43
45 <hr /> 44 <hr />
46 <hr /> 45 <hr />
47 <a NAME="FunctionFinder" ID="FunctionFinder"></a> 46 <a NAME="FunctionFinder" ID="FunctionFinder"></a>
48 <h2>FunctionFinder</h2> 47 <h2>FunctionFinder</h2>
49
50 <p> 48 <p>
51 Class to find all defined functions and methods. 49 Class to find all defined functions and methods.
52 </p> 50 </p>
51
53 <h3>Derived from</h3> 52 <h3>Derived from</h3>
54 ast.NodeVisitor 53 ast.NodeVisitor
55 <h3>Class Attributes</h3> 54 <h3>Class Attributes</h3>
56
57 <table> 55 <table>
58 <tr><td>visit_AsyncFunctionDef</td></tr> 56 <tr><td>visit_AsyncFunctionDef</td></tr>
59 </table> 57 </table>
58
60 <h3>Class Methods</h3> 59 <h3>Class Methods</h3>
61 60 <table>
62 <table> 61 <tr><td>None</td></tr>
63 <tr><td>None</td></tr> 62 </table>
64 </table> 63
65 <h3>Methods</h3> 64 <h3>Methods</h3>
66 65 <table>
67 <table>
68
69 <tr> 66 <tr>
70 <td><a href="#FunctionFinder.__init__">FunctionFinder</a></td> 67 <td><a href="#FunctionFinder.__init__">FunctionFinder</a></td>
71 <td>Constructor</td> 68 <td>Constructor</td>
72 </tr> 69 </tr>
73 <tr> 70 <tr>
77 <tr> 74 <tr>
78 <td><a href="#FunctionFinder.functionNodes">functionNodes</a></td> 75 <td><a href="#FunctionFinder.functionNodes">functionNodes</a></td>
79 <td>Public method to get the list of detected functions and lambdas.</td> 76 <td>Public method to get the list of detected functions and lambdas.</td>
80 </tr> 77 </tr>
81 </table> 78 </table>
79
82 <h3>Static Methods</h3> 80 <h3>Static Methods</h3>
83 81 <table>
84 <table> 82 <tr><td>None</td></tr>
85 <tr><td>None</td></tr> 83 </table>
86 </table> 84
87 85
88 <a NAME="FunctionFinder.__init__" ID="FunctionFinder.__init__"></a> 86 <a NAME="FunctionFinder.__init__" ID="FunctionFinder.__init__"></a>
89 <h4>FunctionFinder (Constructor)</h4> 87 <h4>FunctionFinder (Constructor)</h4>
90 <b>FunctionFinder</b>(<i>onlyTopLevel=False</i>) 88 <b>FunctionFinder</b>(<i>onlyTopLevel=False</i>)
91
92 <p> 89 <p>
93 Constructor 90 Constructor
94 </p> 91 </p>
92
95 <dl> 93 <dl>
96 94
97 <dt><i>onlyTopLevel</i> (bool (optional))</dt> 95 <dt><i>onlyTopLevel</i> (bool (optional))</dt>
98 <dd> 96 <dd>
99 flag indicating to search for top level functions only 97 flag indicating to search for top level functions only
101 </dd> 99 </dd>
102 </dl> 100 </dl>
103 <a NAME="FunctionFinder.__visitFunctionTypes" ID="FunctionFinder.__visitFunctionTypes"></a> 101 <a NAME="FunctionFinder.__visitFunctionTypes" ID="FunctionFinder.__visitFunctionTypes"></a>
104 <h4>FunctionFinder.__visitFunctionTypes</h4> 102 <h4>FunctionFinder.__visitFunctionTypes</h4>
105 <b>__visitFunctionTypes</b>(<i>functionNode</i>) 103 <b>__visitFunctionTypes</b>(<i>functionNode</i>)
106
107 <p> 104 <p>
108 Private method to handle an AST node defining a function or lambda. 105 Private method to handle an AST node defining a function or lambda.
109 </p> 106 </p>
107
110 <dl> 108 <dl>
111 109
112 <dt><i>functionNode</i> (ast.AsyncFunctionDef, ast.FunctionDef or ast.Lambda)</dt> 110 <dt><i>functionNode</i> (ast.AsyncFunctionDef, ast.FunctionDef or ast.Lambda)</dt>
113 <dd> 111 <dd>
114 reference to the node defining a function or lambda 112 reference to the node defining a function or lambda
115 </dd> 113 </dd>
116 </dl> 114 </dl>
117 <a NAME="FunctionFinder.functionNodes" ID="FunctionFinder.functionNodes"></a> 115 <a NAME="FunctionFinder.functionNodes" ID="FunctionFinder.functionNodes"></a>
118 <h4>FunctionFinder.functionNodes</h4> 116 <h4>FunctionFinder.functionNodes</h4>
119 <b>functionNodes</b>(<i></i>) 117 <b>functionNodes</b>(<i></i>)
120
121 <p> 118 <p>
122 Public method to get the list of detected functions and lambdas. 119 Public method to get the list of detected functions and lambdas.
123 </p> 120 </p>
121
124 <dl> 122 <dl>
125 <dt>Return:</dt> 123 <dt>Return:</dt>
126 <dd> 124 <dd>
127 list of detected functions and lambdas 125 list of detected functions and lambdas
128 </dd> 126 </dd>
136 <div align="right"><a href="#top">Up</a></div> 134 <div align="right"><a href="#top">Up</a></div>
137 <hr /> 135 <hr />
138 <hr /> 136 <hr />
139 <a NAME="GlobalVariableLoadCounter" ID="GlobalVariableLoadCounter"></a> 137 <a NAME="GlobalVariableLoadCounter" ID="GlobalVariableLoadCounter"></a>
140 <h2>GlobalVariableLoadCounter</h2> 138 <h2>GlobalVariableLoadCounter</h2>
141
142 <p> 139 <p>
143 Class to find all defined global variables and count their usages. 140 Class to find all defined global variables and count their usages.
144 </p> 141 </p>
142
145 <h3>Derived from</h3> 143 <h3>Derived from</h3>
146 ast.NodeVisitor 144 ast.NodeVisitor
147 <h3>Class Attributes</h3> 145 <h3>Class Attributes</h3>
148 146 <table>
149 <table> 147 <tr><td>None</td></tr>
150 <tr><td>None</td></tr> 148 </table>
151 </table> 149
152 <h3>Class Methods</h3> 150 <h3>Class Methods</h3>
153 151 <table>
154 <table> 152 <tr><td>None</td></tr>
155 <tr><td>None</td></tr> 153 </table>
156 </table> 154
157 <h3>Methods</h3> 155 <h3>Methods</h3>
158 156 <table>
159 <table>
160
161 <tr> 157 <tr>
162 <td><a href="#GlobalVariableLoadCounter.__init__">GlobalVariableLoadCounter</a></td> 158 <td><a href="#GlobalVariableLoadCounter.__init__">GlobalVariableLoadCounter</a></td>
163 <td>Constructor</td> 159 <td>Constructor</td>
164 </tr> 160 </tr>
165 <tr> 161 <tr>
173 <tr> 169 <tr>
174 <td><a href="#GlobalVariableLoadCounter.visit_Name">visit_Name</a></td> 170 <td><a href="#GlobalVariableLoadCounter.visit_Name">visit_Name</a></td>
175 <td>Public method to record the definition and use of a global variable.</td> 171 <td>Public method to record the definition and use of a global variable.</td>
176 </tr> 172 </tr>
177 </table> 173 </table>
174
178 <h3>Static Methods</h3> 175 <h3>Static Methods</h3>
179 176 <table>
180 <table> 177 <tr><td>None</td></tr>
181 <tr><td>None</td></tr> 178 </table>
182 </table> 179
183 180
184 <a NAME="GlobalVariableLoadCounter.__init__" ID="GlobalVariableLoadCounter.__init__"></a> 181 <a NAME="GlobalVariableLoadCounter.__init__" ID="GlobalVariableLoadCounter.__init__"></a>
185 <h4>GlobalVariableLoadCounter (Constructor)</h4> 182 <h4>GlobalVariableLoadCounter (Constructor)</h4>
186 <b>GlobalVariableLoadCounter</b>(<i></i>) 183 <b>GlobalVariableLoadCounter</b>(<i></i>)
187
188 <p> 184 <p>
189 Constructor 185 Constructor
190 </p> 186 </p>
187
191 <a NAME="GlobalVariableLoadCounter.getLoads" ID="GlobalVariableLoadCounter.getLoads"></a> 188 <a NAME="GlobalVariableLoadCounter.getLoads" ID="GlobalVariableLoadCounter.getLoads"></a>
192 <h4>GlobalVariableLoadCounter.getLoads</h4> 189 <h4>GlobalVariableLoadCounter.getLoads</h4>
193 <b>getLoads</b>(<i></i>) 190 <b>getLoads</b>(<i></i>)
194
195 <p> 191 <p>
196 Public method to get an iterator of the detected variable loads. 192 Public method to get an iterator of the detected variable loads.
197 </p> 193 </p>
194
198 <dl> 195 <dl>
199 <dt>Return:</dt> 196 <dt>Return:</dt>
200 <dd> 197 <dd>
201 DESCRIPTION 198 DESCRIPTION
202 </dd> 199 </dd>
208 </dd> 205 </dd>
209 </dl> 206 </dl>
210 <a NAME="GlobalVariableLoadCounter.getStoreInfo" ID="GlobalVariableLoadCounter.getStoreInfo"></a> 207 <a NAME="GlobalVariableLoadCounter.getStoreInfo" ID="GlobalVariableLoadCounter.getStoreInfo"></a>
211 <h4>GlobalVariableLoadCounter.getStoreInfo</h4> 208 <h4>GlobalVariableLoadCounter.getStoreInfo</h4>
212 <b>getStoreInfo</b>(<i>variableId</i>) 209 <b>getStoreInfo</b>(<i>variableId</i>)
213
214 <p> 210 <p>
215 Public method to get the store info data of a given variable ID. 211 Public method to get the store info data of a given variable ID.
216 </p> 212 </p>
213
217 <dl> 214 <dl>
218 215
219 <dt><i>variableId</i> (str)</dt> 216 <dt><i>variableId</i> (str)</dt>
220 <dd> 217 <dd>
221 variable ID to retrieve the store info for 218 variable ID to retrieve the store info for
234 </dd> 231 </dd>
235 </dl> 232 </dl>
236 <a NAME="GlobalVariableLoadCounter.visit_Name" ID="GlobalVariableLoadCounter.visit_Name"></a> 233 <a NAME="GlobalVariableLoadCounter.visit_Name" ID="GlobalVariableLoadCounter.visit_Name"></a>
237 <h4>GlobalVariableLoadCounter.visit_Name</h4> 234 <h4>GlobalVariableLoadCounter.visit_Name</h4>
238 <b>visit_Name</b>(<i>nameNode</i>) 235 <b>visit_Name</b>(<i>nameNode</i>)
239
240 <p> 236 <p>
241 Public method to record the definition and use of a global variable. 237 Public method to record the definition and use of a global variable.
242 </p> 238 </p>
239
243 <dl> 240 <dl>
244 241
245 <dt><i>nameNode</i> (ast.Name)</dt> 242 <dt><i>nameNode</i> (ast.Name)</dt>
246 <dd> 243 <dd>
247 reference to the name node to be processed 244 reference to the name node to be processed
250 <div align="right"><a href="#top">Up</a></div> 247 <div align="right"><a href="#top">Up</a></div>
251 <hr /> 248 <hr />
252 <hr /> 249 <hr />
253 <a NAME="NameFinder" ID="NameFinder"></a> 250 <a NAME="NameFinder" ID="NameFinder"></a>
254 <h2>NameFinder</h2> 251 <h2>NameFinder</h2>
255
256 <p> 252 <p>
257 Class to find the used argument names. 253 Class to find the used argument names.
258 </p> 254 </p>
255
259 <h3>Derived from</h3> 256 <h3>Derived from</h3>
260 ast.NodeVisitor 257 ast.NodeVisitor
261 <h3>Class Attributes</h3> 258 <h3>Class Attributes</h3>
262 259 <table>
263 <table> 260 <tr><td>None</td></tr>
264 <tr><td>None</td></tr> 261 </table>
265 </table> 262
266 <h3>Class Methods</h3> 263 <h3>Class Methods</h3>
267 264 <table>
268 <table> 265 <tr><td>None</td></tr>
269 <tr><td>None</td></tr> 266 </table>
270 </table> 267
271 <h3>Methods</h3> 268 <h3>Methods</h3>
272 269 <table>
273 <table>
274
275 <tr> 270 <tr>
276 <td><a href="#NameFinder.visit_Name">visit_Name</a></td> 271 <td><a href="#NameFinder.visit_Name">visit_Name</a></td>
277 <td>Public method to check a Name node.</td> 272 <td>Public method to check a Name node.</td>
278 </tr> 273 </tr>
279 </table> 274 </table>
275
280 <h3>Static Methods</h3> 276 <h3>Static Methods</h3>
281 277 <table>
282 <table> 278 <tr><td>None</td></tr>
283 <tr><td>None</td></tr> 279 </table>
284 </table> 280
285 281
286 <a NAME="NameFinder.visit_Name" ID="NameFinder.visit_Name"></a> 282 <a NAME="NameFinder.visit_Name" ID="NameFinder.visit_Name"></a>
287 <h4>NameFinder.visit_Name</h4> 283 <h4>NameFinder.visit_Name</h4>
288 <b>visit_Name</b>(<i>name</i>) 284 <b>visit_Name</b>(<i>name</i>)
289
290 <p> 285 <p>
291 Public method to check a Name node. 286 Public method to check a Name node.
292 </p> 287 </p>
288
293 <dl> 289 <dl>
294 290
295 <dt><i>name</i> (ast.Name)</dt> 291 <dt><i>name</i> (ast.Name)</dt>
296 <dd> 292 <dd>
297 reference to the name node to be checked 293 reference to the name node to be checked
300 <div align="right"><a href="#top">Up</a></div> 296 <div align="right"><a href="#top">Up</a></div>
301 <hr /> 297 <hr />
302 <hr /> 298 <hr />
303 <a NAME="UnusedChecker" ID="UnusedChecker"></a> 299 <a NAME="UnusedChecker" ID="UnusedChecker"></a>
304 <h2>UnusedChecker</h2> 300 <h2>UnusedChecker</h2>
305
306 <p> 301 <p>
307 Class implementing a checker for unused arguments, variables, ... . 302 Class implementing a checker for unused arguments, variables, ... .
308 </p> 303 </p>
304
309 <h3>Derived from</h3> 305 <h3>Derived from</h3>
310 None 306 None
311 <h3>Class Attributes</h3> 307 <h3>Class Attributes</h3>
312
313 <table> 308 <table>
314 <tr><td>Codes</td></tr> 309 <tr><td>Codes</td></tr>
315 </table> 310 </table>
311
316 <h3>Class Methods</h3> 312 <h3>Class Methods</h3>
317 313 <table>
318 <table> 314 <tr><td>None</td></tr>
319 <tr><td>None</td></tr> 315 </table>
320 </table> 316
321 <h3>Methods</h3> 317 <h3>Methods</h3>
322 318 <table>
323 <table>
324
325 <tr> 319 <tr>
326 <td><a href="#UnusedChecker.__init__">UnusedChecker</a></td> 320 <td><a href="#UnusedChecker.__init__">UnusedChecker</a></td>
327 <td>Constructor</td> 321 <td>Constructor</td>
328 </tr> 322 </tr>
329 <tr> 323 <tr>
373 <tr> 367 <tr>
374 <td><a href="#UnusedChecker.run">run</a></td> 368 <td><a href="#UnusedChecker.run">run</a></td>
375 <td>Public method to check the given source against miscellaneous conditions.</td> 369 <td>Public method to check the given source against miscellaneous conditions.</td>
376 </tr> 370 </tr>
377 </table> 371 </table>
372
378 <h3>Static Methods</h3> 373 <h3>Static Methods</h3>
379 374 <table>
380 <table> 375 <tr><td>None</td></tr>
381 <tr><td>None</td></tr> 376 </table>
382 </table> 377
383 378
384 <a NAME="UnusedChecker.__init__" ID="UnusedChecker.__init__"></a> 379 <a NAME="UnusedChecker.__init__" ID="UnusedChecker.__init__"></a>
385 <h4>UnusedChecker (Constructor)</h4> 380 <h4>UnusedChecker (Constructor)</h4>
386 <b>UnusedChecker</b>(<i>source, filename, tree, select, ignore, expected, repeat, args</i>) 381 <b>UnusedChecker</b>(<i>source, filename, tree, select, ignore, expected, repeat, args</i>)
387
388 <p> 382 <p>
389 Constructor 383 Constructor
390 </p> 384 </p>
385
391 <dl> 386 <dl>
392 387
393 <dt><i>source</i> (list of str)</dt> 388 <dt><i>source</i> (list of str)</dt>
394 <dd> 389 <dd>
395 source code to be checked 390 source code to be checked
424 </dd> 419 </dd>
425 </dl> 420 </dl>
426 <a NAME="UnusedChecker.__checkUnusedArguments" ID="UnusedChecker.__checkUnusedArguments"></a> 421 <a NAME="UnusedChecker.__checkUnusedArguments" ID="UnusedChecker.__checkUnusedArguments"></a>
427 <h4>UnusedChecker.__checkUnusedArguments</h4> 422 <h4>UnusedChecker.__checkUnusedArguments</h4>
428 <b>__checkUnusedArguments</b>(<i></i>) 423 <b>__checkUnusedArguments</b>(<i></i>)
429
430 <p> 424 <p>
431 Private method to check function and method definitions for unused arguments. 425 Private method to check function and method definitions for unused arguments.
432 </p> 426 </p>
427
433 <a NAME="UnusedChecker.__checkUnusedGlobals" ID="UnusedChecker.__checkUnusedGlobals"></a> 428 <a NAME="UnusedChecker.__checkUnusedGlobals" ID="UnusedChecker.__checkUnusedGlobals"></a>
434 <h4>UnusedChecker.__checkUnusedGlobals</h4> 429 <h4>UnusedChecker.__checkUnusedGlobals</h4>
435 <b>__checkUnusedGlobals</b>(<i></i>) 430 <b>__checkUnusedGlobals</b>(<i></i>)
436
437 <p> 431 <p>
438 Private method to check for unused global variables. 432 Private method to check for unused global variables.
439 </p> 433 </p>
434
440 <a NAME="UnusedChecker.__error" ID="UnusedChecker.__error"></a> 435 <a NAME="UnusedChecker.__error" ID="UnusedChecker.__error"></a>
441 <h4>UnusedChecker.__error</h4> 436 <h4>UnusedChecker.__error</h4>
442 <b>__error</b>(<i>lineNumber, offset, code, *args</i>) 437 <b>__error</b>(<i>lineNumber, offset, code, *args</i>)
443
444 <p> 438 <p>
445 Private method to record an issue. 439 Private method to record an issue.
446 </p> 440 </p>
441
447 <dl> 442 <dl>
448 443
449 <dt><i>lineNumber</i> (int)</dt> 444 <dt><i>lineNumber</i> (int)</dt>
450 <dd> 445 <dd>
451 line number of the issue 446 line number of the issue
464 </dd> 459 </dd>
465 </dl> 460 </dl>
466 <a NAME="UnusedChecker.__extractGlobalVariables" ID="UnusedChecker.__extractGlobalVariables"></a> 461 <a NAME="UnusedChecker.__extractGlobalVariables" ID="UnusedChecker.__extractGlobalVariables"></a>
467 <h4>UnusedChecker.__extractGlobalVariables</h4> 462 <h4>UnusedChecker.__extractGlobalVariables</h4>
468 <b>__extractGlobalVariables</b>(<i></i>) 463 <b>__extractGlobalVariables</b>(<i></i>)
469
470 <p> 464 <p>
471 Private method to get the names of all global variables. 465 Private method to get the names of all global variables.
472 </p> 466 </p>
467
473 <dl> 468 <dl>
474 <dt>Return:</dt> 469 <dt>Return:</dt>
475 <dd> 470 <dd>
476 set containing the defined global variable names 471 set containing the defined global variable names
477 </dd> 472 </dd>
483 </dd> 478 </dd>
484 </dl> 479 </dl>
485 <a NAME="UnusedChecker.__getArguments" ID="UnusedChecker.__getArguments"></a> 480 <a NAME="UnusedChecker.__getArguments" ID="UnusedChecker.__getArguments"></a>
486 <h4>UnusedChecker.__getArguments</h4> 481 <h4>UnusedChecker.__getArguments</h4>
487 <b>__getArguments</b>(<i>functionNode</i>) 482 <b>__getArguments</b>(<i>functionNode</i>)
488
489 <p> 483 <p>
490 Private method to get all argument names of the given function. 484 Private method to get all argument names of the given function.
491 </p> 485 </p>
486
492 <dl> 487 <dl>
493 488
494 <dt><i>functionNode</i> (ast.AsyncFunctionDef, ast.FunctionDef or ast.Lambda)</dt> 489 <dt><i>functionNode</i> (ast.AsyncFunctionDef, ast.FunctionDef or ast.Lambda)</dt>
495 <dd> 490 <dd>
496 reference to the node defining the function or lambda 491 reference to the node defining the function or lambda
509 </dd> 504 </dd>
510 </dl> 505 </dl>
511 <a NAME="UnusedChecker.__getDecoratorNames" ID="UnusedChecker.__getDecoratorNames"></a> 506 <a NAME="UnusedChecker.__getDecoratorNames" ID="UnusedChecker.__getDecoratorNames"></a>
512 <h4>UnusedChecker.__getDecoratorNames</h4> 507 <h4>UnusedChecker.__getDecoratorNames</h4>
513 <b>__getDecoratorNames</b>(<i>functionNode</i>) 508 <b>__getDecoratorNames</b>(<i>functionNode</i>)
514
515 <p> 509 <p>
516 Private method to yield the decorator names of the function. 510 Private method to yield the decorator names of the function.
517 </p> 511 </p>
512
518 <dl> 513 <dl>
519 514
520 <dt><i>functionNode</i> (ast.AsyncFunctionDef, ast.FunctionDef or ast.Lambda)</dt> 515 <dt><i>functionNode</i> (ast.AsyncFunctionDef, ast.FunctionDef or ast.Lambda)</dt>
521 <dd> 516 <dd>
522 reference to the node defining the function or lambda 517 reference to the node defining the function or lambda
535 </dd> 530 </dd>
536 </dl> 531 </dl>
537 <a NAME="UnusedChecker.__getUnusedArguments" ID="UnusedChecker.__getUnusedArguments"></a> 532 <a NAME="UnusedChecker.__getUnusedArguments" ID="UnusedChecker.__getUnusedArguments"></a>
538 <h4>UnusedChecker.__getUnusedArguments</h4> 533 <h4>UnusedChecker.__getUnusedArguments</h4>
539 <b>__getUnusedArguments</b>(<i>functionNode</i>) 534 <b>__getUnusedArguments</b>(<i>functionNode</i>)
540
541 <p> 535 <p>
542 Private method to get a list of unused arguments of the given function. 536 Private method to get a list of unused arguments of the given function.
543 </p> 537 </p>
538
544 <dl> 539 <dl>
545 540
546 <dt><i>functionNode</i> (ast.AsyncFunctionDef, ast.FunctionDef or ast.Lambda)</dt> 541 <dt><i>functionNode</i> (ast.AsyncFunctionDef, ast.FunctionDef or ast.Lambda)</dt>
547 <dd> 542 <dd>
548 reference to the node defining the function or lambda 543 reference to the node defining the function or lambda
561 </dd> 556 </dd>
562 </dl> 557 </dl>
563 <a NAME="UnusedChecker.__ignoreCode" ID="UnusedChecker.__ignoreCode"></a> 558 <a NAME="UnusedChecker.__ignoreCode" ID="UnusedChecker.__ignoreCode"></a>
564 <h4>UnusedChecker.__ignoreCode</h4> 559 <h4>UnusedChecker.__ignoreCode</h4>
565 <b>__ignoreCode</b>(<i>code</i>) 560 <b>__ignoreCode</b>(<i>code</i>)
566
567 <p> 561 <p>
568 Private method to check if the message code should be ignored. 562 Private method to check if the message code should be ignored.
569 </p> 563 </p>
564
570 <dl> 565 <dl>
571 566
572 <dt><i>code</i> (str)</dt> 567 <dt><i>code</i> (str)</dt>
573 <dd> 568 <dd>
574 message code to check for 569 message code to check for
587 </dd> 582 </dd>
588 </dl> 583 </dl>
589 <a NAME="UnusedChecker.__isDunderMethod" ID="UnusedChecker.__isDunderMethod"></a> 584 <a NAME="UnusedChecker.__isDunderMethod" ID="UnusedChecker.__isDunderMethod"></a>
590 <h4>UnusedChecker.__isDunderMethod</h4> 585 <h4>UnusedChecker.__isDunderMethod</h4>
591 <b>__isDunderMethod</b>(<i>functionNode</i>) 586 <b>__isDunderMethod</b>(<i>functionNode</i>)
592
593 <p> 587 <p>
594 Private method to check, if the function node defines a special function. 588 Private method to check, if the function node defines a special function.
595 </p> 589 </p>
590
596 <dl> 591 <dl>
597 592
598 <dt><i>functionNode</i> (ast.AsyncFunctionDef, ast.FunctionDef or ast.Lambda)</dt> 593 <dt><i>functionNode</i> (ast.AsyncFunctionDef, ast.FunctionDef or ast.Lambda)</dt>
599 <dd> 594 <dd>
600 reference to the node defining the function or lambda 595 reference to the node defining the function or lambda
613 </dd> 608 </dd>
614 </dl> 609 </dl>
615 <a NAME="UnusedChecker.__isEventHandlerMethod" ID="UnusedChecker.__isEventHandlerMethod"></a> 610 <a NAME="UnusedChecker.__isEventHandlerMethod" ID="UnusedChecker.__isEventHandlerMethod"></a>
616 <h4>UnusedChecker.__isEventHandlerMethod</h4> 611 <h4>UnusedChecker.__isEventHandlerMethod</h4>
617 <b>__isEventHandlerMethod</b>(<i>functionNode</i>) 612 <b>__isEventHandlerMethod</b>(<i>functionNode</i>)
618
619 <p> 613 <p>
620 Private method to check, if the function node defines a Qt event handler. 614 Private method to check, if the function node defines a Qt event handler.
621 </p> 615 </p>
622 <p> 616 <p>
623 Qt event handler methods are assumed to end with 'Event' or have the name 617 Qt event handler methods are assumed to end with 'Event' or have the name
624 'event' or 'eventFilter'. Only standard methodes (i.e. ast.FunctionDef) 618 'event' or 'eventFilter'. Only standard methodes (i.e. ast.FunctionDef)
625 are assumed to be potential event handlers. 619 are assumed to be potential event handlers.
626 </p> 620 </p>
621
627 <dl> 622 <dl>
628 623
629 <dt><i>functionNode</i> (ast.AsyncFunctionDef, ast.FunctionDef or ast.Lambda)</dt> 624 <dt><i>functionNode</i> (ast.AsyncFunctionDef, ast.FunctionDef or ast.Lambda)</dt>
630 <dd> 625 <dd>
631 reference to the node defining the function or lambda 626 reference to the node defining the function or lambda
644 </dd> 639 </dd>
645 </dl> 640 </dl>
646 <a NAME="UnusedChecker.__isStubFunction" ID="UnusedChecker.__isStubFunction"></a> 641 <a NAME="UnusedChecker.__isStubFunction" ID="UnusedChecker.__isStubFunction"></a>
647 <h4>UnusedChecker.__isStubFunction</h4> 642 <h4>UnusedChecker.__isStubFunction</h4>
648 <b>__isStubFunction</b>(<i>functionNode</i>) 643 <b>__isStubFunction</b>(<i>functionNode</i>)
649
650 <p> 644 <p>
651 Private method to check, if the given function node defines a stub function. 645 Private method to check, if the given function node defines a stub function.
652 </p> 646 </p>
647
653 <dl> 648 <dl>
654 649
655 <dt><i>functionNode</i> (ast.AsyncFunctionDef, ast.FunctionDef or ast.Lambda)</dt> 650 <dt><i>functionNode</i> (ast.AsyncFunctionDef, ast.FunctionDef or ast.Lambda)</dt>
656 <dd> 651 <dd>
657 reference to the node defining the function or lambda 652 reference to the node defining the function or lambda
670 </dd> 665 </dd>
671 </dl> 666 </dl>
672 <a NAME="UnusedChecker.run" ID="UnusedChecker.run"></a> 667 <a NAME="UnusedChecker.run" ID="UnusedChecker.run"></a>
673 <h4>UnusedChecker.run</h4> 668 <h4>UnusedChecker.run</h4>
674 <b>run</b>(<i></i>) 669 <b>run</b>(<i></i>)
675
676 <p> 670 <p>
677 Public method to check the given source against miscellaneous 671 Public method to check the given source against miscellaneous
678 conditions. 672 conditions.
679 </p> 673 </p>
674
680 <div align="right"><a href="#top">Up</a></div> 675 <div align="right"><a href="#top">Up</a></div>
681 <hr /> 676 <hr />
682 </body></html> 677 </body></html>

eric ide

mercurial