src/eric7/Documentation/Source/eric7.Plugins.CheckerPlugins.CodeStyleChecker.Miscellaneous.MiscellaneousChecker.html

branch
eric7
changeset 11139
cd22e8e705f4
parent 11000
f8371a2dd08f
child 11140
b823386f7591
equal deleted inserted replaced
11138:1f743bad6fd3 11139:cd22e8e705f4
45 <tr> 45 <tr>
46 <td><a href="#M540CaughtException">M540CaughtException</a></td> 46 <td><a href="#M540CaughtException">M540CaughtException</a></td>
47 <td>Class to hold the data for a caught exception.</td> 47 <td>Class to hold the data for a caught exception.</td>
48 </tr> 48 </tr>
49 <tr> 49 <tr>
50 <td><a href="#M541UnhandledKeyType">M541UnhandledKeyType</a></td>
51 <td>Class to hold a dictionary key of a type that we do not check for duplicates.</td>
52 </tr>
53 <tr>
54 <td><a href="#M541VariableKeyType">M541VariableKeyType</a></td>
55 <td>Class to hold the name of a variable key type.</td>
56 </tr>
57 <tr>
50 <td><a href="#M569Checker">M569Checker</a></td> 58 <td><a href="#M569Checker">M569Checker</a></td>
51 <td>Class traversing a 'for' loop body to check for modifications to a loop's mutable iterable.</td> 59 <td>Class traversing a 'for' loop body to check for modifications to a loop's mutable iterable.</td>
52 </tr> 60 </tr>
53 <tr> 61 <tr>
54 <td><a href="#MiscellaneousChecker">MiscellaneousChecker</a></td> 62 <td><a href="#MiscellaneousChecker">MiscellaneousChecker</a></td>
131 <tr> 139 <tr>
132 <td><a href="#BugBearVisitor.__checkForM512">__checkForM512</a></td> 140 <td><a href="#BugBearVisitor.__checkForM512">__checkForM512</a></td>
133 <td>Private method to check for return/continue/break inside finally blocks.</td> 141 <td>Private method to check for return/continue/break inside finally blocks.</td>
134 </tr> 142 </tr>
135 <tr> 143 <tr>
136 <td><a href="#BugBearVisitor.__checkForM513_M529_M530">__checkForM513_M529_M530</a></td> 144 <td><a href="#BugBearVisitor.__checkForM513_M514_M529_M530">__checkForM513_M514_M529_M530</a></td>
137 <td>Private method to check various exception handler situations.</td> 145 <td>Private method to check various exception handler situations.</td>
138 </tr> 146 </tr>
139 <tr> 147 <tr>
140 <td><a href="#BugBearVisitor.__checkForM515">__checkForM515</a></td> 148 <td><a href="#BugBearVisitor.__checkForM515">__checkForM515</a></td>
141 <td>Private method to check for pointless comparisons.</td> 149 <td>Private method to check for pointless comparisons.</td>
219 <tr> 227 <tr>
220 <td><a href="#BugBearVisitor.__checkForM540Usage">__checkForM540Usage</a></td> 228 <td><a href="#BugBearVisitor.__checkForM540Usage">__checkForM540Usage</a></td>
221 <td>Private method to check the usage of exceptions with added note.</td> 229 <td>Private method to check the usage of exceptions with added note.</td>
222 </tr> 230 </tr>
223 <tr> 231 <tr>
232 <td><a href="#BugBearVisitor.__checkForM541">__checkForM541</a></td>
233 <td>Private method to check for duplicate key value pairs in a dictionary literal.</td>
234 </tr>
235 <tr>
224 <td><a href="#BugBearVisitor.__checkForM569">__checkForM569</a></td> 236 <td><a href="#BugBearVisitor.__checkForM569">__checkForM569</a></td>
225 <td>Private method to check for changes to a loop's mutable iterable.</td> 237 <td>Private method to check for changes to a loop's mutable iterable.</td>
226 </tr> 238 </tr>
227 <tr> 239 <tr>
228 <td><a href="#BugBearVisitor.__checkRedundantExcepthandlers">__checkRedundantExcepthandlers</a></td> 240 <td><a href="#BugBearVisitor.__checkRedundantExcepthandlers">__checkRedundantExcepthandlers</a></td>
275 <tr> 287 <tr>
276 <td><a href="#BugBearVisitor.check">check</a></td> 288 <td><a href="#BugBearVisitor.check">check</a></td>
277 <td></td> 289 <td></td>
278 </tr> 290 </tr>
279 <tr> 291 <tr>
292 <td><a href="#BugBearVisitor.convertToValue">convertToValue</a></td>
293 <td>Function to extract the value of a given item.</td>
294 </tr>
295 <tr>
280 <td><a href="#BugBearVisitor.emptyBody">emptyBody</a></td> 296 <td><a href="#BugBearVisitor.emptyBody">emptyBody</a></td>
281 <td></td> 297 <td></td>
282 </tr> 298 </tr>
283 <tr> 299 <tr>
284 <td><a href="#BugBearVisitor.isAbcClass">isAbcClass</a></td> 300 <td><a href="#BugBearVisitor.isAbcClass">isAbcClass</a></td>
343 <tr> 359 <tr>
344 <td><a href="#BugBearVisitor.visit_Compare">visit_Compare</a></td> 360 <td><a href="#BugBearVisitor.visit_Compare">visit_Compare</a></td>
345 <td>Public method to handle comparison statements.</td> 361 <td>Public method to handle comparison statements.</td>
346 </tr> 362 </tr>
347 <tr> 363 <tr>
364 <td><a href="#BugBearVisitor.visit_Dict">visit_Dict</a></td>
365 <td>Public method to check a dictionary.</td>
366 </tr>
367 <tr>
348 <td><a href="#BugBearVisitor.visit_DictComp">visit_DictComp</a></td> 368 <td><a href="#BugBearVisitor.visit_DictComp">visit_DictComp</a></td>
349 <td>Public method to handle dictionary comprehensions.</td> 369 <td>Public method to handle dictionary comprehensions.</td>
350 </tr> 370 </tr>
351 <tr> 371 <tr>
352 <td><a href="#BugBearVisitor.visit_ExceptHandler">visit_ExceptHandler</a></td> 372 <td><a href="#BugBearVisitor.visit_ExceptHandler">visit_ExceptHandler</a></td>
400 <td><a href="#BugBearVisitor.visit_SetComp">visit_SetComp</a></td> 420 <td><a href="#BugBearVisitor.visit_SetComp">visit_SetComp</a></td>
401 <td>Public method to handle set comprehensions.</td> 421 <td>Public method to handle set comprehensions.</td>
402 </tr> 422 </tr>
403 <tr> 423 <tr>
404 <td><a href="#BugBearVisitor.visit_Try">visit_Try</a></td> 424 <td><a href="#BugBearVisitor.visit_Try">visit_Try</a></td>
405 <td>Public method to handle 'try' statements'.</td> 425 <td>Public method to handle 'try' statements.</td>
426 </tr>
427 <tr>
428 <td><a href="#BugBearVisitor.visit_TryStar">visit_TryStar</a></td>
429 <td>Public method to handle 'except*' statements.</td>
406 </tr> 430 </tr>
407 <tr> 431 <tr>
408 <td><a href="#BugBearVisitor.visit_UAdd">visit_UAdd</a></td> 432 <td><a href="#BugBearVisitor.visit_UAdd">visit_UAdd</a></td>
409 <td>Public method to handle unary additions.</td> 433 <td>Public method to handle unary additions.</td>
410 </tr> 434 </tr>
493 <dt><i>node</i> (ast.Try)</dt> 517 <dt><i>node</i> (ast.Try)</dt>
494 <dd> 518 <dd>
495 reference to the node to be processed 519 reference to the node to be processed
496 </dd> 520 </dd>
497 </dl> 521 </dl>
498 <a NAME="BugBearVisitor.__checkForM513_M529_M530" ID="BugBearVisitor.__checkForM513_M529_M530"></a> 522 <a NAME="BugBearVisitor.__checkForM513_M514_M529_M530" ID="BugBearVisitor.__checkForM513_M514_M529_M530"></a>
499 <h4>BugBearVisitor.__checkForM513_M529_M530</h4> 523 <h4>BugBearVisitor.__checkForM513_M514_M529_M530</h4>
500 <b>__checkForM513_M529_M530</b>(<i>node</i>) 524 <b>__checkForM513_M514_M529_M530</b>(<i>node</i>)
501 <p> 525 <p>
502 Private method to check various exception handler situations. 526 Private method to check various exception handler situations.
503 </p> 527 </p>
504 528
505 <dl> 529 <dl>
839 <dt><i>node</i> (ast.expr or None)</dt> 863 <dt><i>node</i> (ast.expr or None)</dt>
840 <dd> 864 <dd>
841 reference to the node to be processed 865 reference to the node to be processed
842 </dd> 866 </dd>
843 </dl> 867 </dl>
868 <a NAME="BugBearVisitor.__checkForM541" ID="BugBearVisitor.__checkForM541"></a>
869 <h4>BugBearVisitor.__checkForM541</h4>
870 <b>__checkForM541</b>(<i>node</i>)
871 <p>
872 Private method to check for duplicate key value pairs in a dictionary literal.
873 </p>
874
875 <dl>
876
877 <dt><i>node</i> (ast.Dict)</dt>
878 <dd>
879 reference to the node to be processed
880 </dd>
881 </dl>
844 <a NAME="BugBearVisitor.__checkForM569" ID="BugBearVisitor.__checkForM569"></a> 882 <a NAME="BugBearVisitor.__checkForM569" ID="BugBearVisitor.__checkForM569"></a>
845 <h4>BugBearVisitor.__checkForM569</h4> 883 <h4>BugBearVisitor.__checkForM569</h4>
846 <b>__checkForM569</b>(<i>node</i>) 884 <b>__checkForM569</b>(<i>node</i>)
847 <p> 885 <p>
848 Private method to check for changes to a loop's mutable iterable. 886 Private method to check for changes to a loop's mutable iterable.
855 loop node to be checked 893 loop node to be checked
856 </dd> 894 </dd>
857 </dl> 895 </dl>
858 <a NAME="BugBearVisitor.__checkRedundantExcepthandlers" ID="BugBearVisitor.__checkRedundantExcepthandlers"></a> 896 <a NAME="BugBearVisitor.__checkRedundantExcepthandlers" ID="BugBearVisitor.__checkRedundantExcepthandlers"></a>
859 <h4>BugBearVisitor.__checkRedundantExcepthandlers</h4> 897 <h4>BugBearVisitor.__checkRedundantExcepthandlers</h4>
860 <b>__checkRedundantExcepthandlers</b>(<i>names, node</i>) 898 <b>__checkRedundantExcepthandlers</b>(<i>names, node, inTryStar</i>)
861 <p> 899 <p>
862 Private method to check for redundant exception types in an exception handler. 900 Private method to check for redundant exception types in an exception handler.
863 </p> 901 </p>
864 902
865 <dl> 903 <dl>
869 list of exception types to be checked 907 list of exception types to be checked
870 </dd> 908 </dd>
871 <dt><i>node</i> (ast.ExceptionHandler)</dt> 909 <dt><i>node</i> (ast.ExceptionHandler)</dt>
872 <dd> 910 <dd>
873 reference to the exception handler node 911 reference to the exception handler node
912 </dd>
913 <dt><i>inTryStar</i> (str)</dt>
914 <dd>
915 character indicating an 'except*' handler
874 </dd> 916 </dd>
875 </dl> 917 </dl>
876 <dl> 918 <dl>
877 <dt>Return:</dt> 919 <dt>Return:</dt>
878 <dd> 920 <dd>
1151 1193
1152 <a NAME="BugBearVisitor.check" ID="BugBearVisitor.check"></a> 1194 <a NAME="BugBearVisitor.check" ID="BugBearVisitor.check"></a>
1153 <h4>BugBearVisitor.check</h4> 1195 <h4>BugBearVisitor.check</h4>
1154 <b>check</b>(<i>paramName</i>) 1196 <b>check</b>(<i>paramName</i>)
1155 1197
1198 <a NAME="BugBearVisitor.convertToValue" ID="BugBearVisitor.convertToValue"></a>
1199 <h4>BugBearVisitor.convertToValue</h4>
1200 <b>convertToValue</b>(<i></i>)
1201 <p>
1202 Function to extract the value of a given item.
1203 </p>
1204
1205 <dl>
1206
1207 <dt><i>item</i> (ast.Ast)</dt>
1208 <dd>
1209 node to extract value from
1210 </dd>
1211 </dl>
1212 <dl>
1213 <dt>Return:</dt>
1214 <dd>
1215 value of the node
1216 </dd>
1217 </dl>
1218 <dl>
1219 <dt>Return Type:</dt>
1220 <dd>
1221 Any
1222 </dd>
1223 </dl>
1156 <a NAME="BugBearVisitor.emptyBody" ID="BugBearVisitor.emptyBody"></a> 1224 <a NAME="BugBearVisitor.emptyBody" ID="BugBearVisitor.emptyBody"></a>
1157 <h4>BugBearVisitor.emptyBody</h4> 1225 <h4>BugBearVisitor.emptyBody</h4>
1158 <b>emptyBody</b>(<i></i>) 1226 <b>emptyBody</b>(<i></i>)
1159 1227
1160 <a NAME="BugBearVisitor.isAbcClass" ID="BugBearVisitor.isAbcClass"></a> 1228 <a NAME="BugBearVisitor.isAbcClass" ID="BugBearVisitor.isAbcClass"></a>
1372 <dt><i>node</i> (ast.Compare)</dt> 1440 <dt><i>node</i> (ast.Compare)</dt>
1373 <dd> 1441 <dd>
1374 reference to the node to be processed 1442 reference to the node to be processed
1375 </dd> 1443 </dd>
1376 </dl> 1444 </dl>
1445 <a NAME="BugBearVisitor.visit_Dict" ID="BugBearVisitor.visit_Dict"></a>
1446 <h4>BugBearVisitor.visit_Dict</h4>
1447 <b>visit_Dict</b>(<i>node</i>)
1448 <p>
1449 Public method to check a dictionary.
1450 </p>
1451
1452 <dl>
1453
1454 <dt><i>node</i> (ast.Dict)</dt>
1455 <dd>
1456 reference to the node to be processed
1457 </dd>
1458 </dl>
1377 <a NAME="BugBearVisitor.visit_DictComp" ID="BugBearVisitor.visit_DictComp"></a> 1459 <a NAME="BugBearVisitor.visit_DictComp" ID="BugBearVisitor.visit_DictComp"></a>
1378 <h4>BugBearVisitor.visit_DictComp</h4> 1460 <h4>BugBearVisitor.visit_DictComp</h4>
1379 <b>visit_DictComp</b>(<i>node</i>) 1461 <b>visit_DictComp</b>(<i>node</i>)
1380 <p> 1462 <p>
1381 Public method to handle dictionary comprehensions. 1463 Public method to handle dictionary comprehensions.
1572 </dl> 1654 </dl>
1573 <a NAME="BugBearVisitor.visit_Try" ID="BugBearVisitor.visit_Try"></a> 1655 <a NAME="BugBearVisitor.visit_Try" ID="BugBearVisitor.visit_Try"></a>
1574 <h4>BugBearVisitor.visit_Try</h4> 1656 <h4>BugBearVisitor.visit_Try</h4>
1575 <b>visit_Try</b>(<i>node</i>) 1657 <b>visit_Try</b>(<i>node</i>)
1576 <p> 1658 <p>
1577 Public method to handle 'try' statements'. 1659 Public method to handle 'try' statements.
1578 </p> 1660 </p>
1579 1661
1580 <dl> 1662 <dl>
1581 1663
1582 <dt><i>node</i> (ast.Try)</dt> 1664 <dt><i>node</i> (ast.Try)</dt>
1665 <dd>
1666 reference to the node to be processed
1667 </dd>
1668 </dl>
1669 <a NAME="BugBearVisitor.visit_TryStar" ID="BugBearVisitor.visit_TryStar"></a>
1670 <h4>BugBearVisitor.visit_TryStar</h4>
1671 <b>visit_TryStar</b>(<i>node</i>)
1672 <p>
1673 Public method to handle 'except*' statements.
1674 </p>
1675
1676 <dl>
1677
1678 <dt><i>node</i> (ast.TryStar)</dt>
1583 <dd> 1679 <dd>
1584 reference to the node to be processed 1680 reference to the node to be processed
1585 </dd> 1681 </dd>
1586 </dl> 1682 </dl>
1587 <a NAME="BugBearVisitor.visit_UAdd" ID="BugBearVisitor.visit_UAdd"></a> 1683 <a NAME="BugBearVisitor.visit_UAdd" ID="BugBearVisitor.visit_UAdd"></a>
2152 2248
2153 2249
2154 <div align="right"><a href="#top">Up</a></div> 2250 <div align="right"><a href="#top">Up</a></div>
2155 <hr /> 2251 <hr />
2156 <hr /> 2252 <hr />
2253 <a NAME="M541UnhandledKeyType" ID="M541UnhandledKeyType"></a>
2254 <h2>M541UnhandledKeyType</h2>
2255 <p>
2256 Class to hold a dictionary key of a type that we do not check for duplicates.
2257 </p>
2258
2259 <h3>Derived from</h3>
2260 None
2261 <h3>Class Attributes</h3>
2262 <table>
2263 <tr><td>None</td></tr>
2264 </table>
2265
2266 <h3>Class Methods</h3>
2267 <table>
2268 <tr><td>None</td></tr>
2269 </table>
2270
2271 <h3>Methods</h3>
2272 <table>
2273 <tr><td>None</td></tr>
2274 </table>
2275
2276 <h3>Static Methods</h3>
2277 <table>
2278 <tr><td>None</td></tr>
2279 </table>
2280
2281
2282 <div align="right"><a href="#top">Up</a></div>
2283 <hr />
2284 <hr />
2285 <a NAME="M541VariableKeyType" ID="M541VariableKeyType"></a>
2286 <h2>M541VariableKeyType</h2>
2287 <p>
2288 Class to hold the name of a variable key type.
2289 </p>
2290
2291 <h3>Derived from</h3>
2292 None
2293 <h3>Class Attributes</h3>
2294 <table>
2295 <tr><td>None</td></tr>
2296 </table>
2297
2298 <h3>Class Methods</h3>
2299 <table>
2300 <tr><td>None</td></tr>
2301 </table>
2302
2303 <h3>Methods</h3>
2304 <table>
2305 <tr>
2306 <td><a href="#M541VariableKeyType.__init__">M541VariableKeyType</a></td>
2307 <td>Constructor</td>
2308 </tr>
2309 </table>
2310
2311 <h3>Static Methods</h3>
2312 <table>
2313 <tr><td>None</td></tr>
2314 </table>
2315
2316
2317 <a NAME="M541VariableKeyType.__init__" ID="M541VariableKeyType.__init__"></a>
2318 <h4>M541VariableKeyType (Constructor)</h4>
2319 <b>M541VariableKeyType</b>(<i>name</i>)
2320 <p>
2321 Constructor
2322 </p>
2323
2324 <dl>
2325
2326 <dt><i>name</i> (str)</dt>
2327 <dd>
2328 name of the variable key type
2329 </dd>
2330 </dl>
2331 <div align="right"><a href="#top">Up</a></div>
2332 <hr />
2333 <hr />
2157 <a NAME="M569Checker" ID="M569Checker"></a> 2334 <a NAME="M569Checker" ID="M569Checker"></a>
2158 <h2>M569Checker</h2> 2335 <h2>M569Checker</h2>
2159 <p> 2336 <p>
2160 Class traversing a 'for' loop body to check for modifications to a loop's 2337 Class traversing a 'for' loop body to check for modifications to a loop's
2161 mutable iterable. 2338 mutable iterable.
2496 <b>__checkComprehensions</b>(<i></i>) 2673 <b>__checkComprehensions</b>(<i></i>)
2497 <p> 2674 <p>
2498 Private method to check some comprehension related things. 2675 Private method to check some comprehension related things.
2499 </p> 2676 </p>
2500 <p> 2677 <p>
2501 This method is adapted from: flake8-comprehensions v3.15.0 2678 This method is adapted from: flake8-comprehensions v3.16.0
2502 Original: Copyright (c) 2017 Adam Johnson 2679 Original: Copyright (c) 2017 Adam Johnson
2503 </p> 2680 </p>
2504 2681
2505 <a NAME="MiscellaneousChecker.__checkCopyright" ID="MiscellaneousChecker.__checkCopyright"></a> 2682 <a NAME="MiscellaneousChecker.__checkCopyright" ID="MiscellaneousChecker.__checkCopyright"></a>
2506 <h4>MiscellaneousChecker.__checkCopyright</h4> 2683 <h4>MiscellaneousChecker.__checkCopyright</h4>

eric ide

mercurial