|
1 <!DOCTYPE html> |
|
2 <html><head> |
|
3 <title>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Security.SecurityChecker</title> |
|
4 <meta charset="UTF-8"> |
|
5 <link rel="stylesheet" href="styles.css"> |
|
6 </head> |
|
7 <body> |
|
8 <a NAME="top" ID="top"></a> |
|
9 <h1>eric7.Plugins.CheckerPlugins.CodeStyleChecker.Security.SecurityChecker</h1> |
|
10 |
|
11 <p> |
|
12 Module implementing the security checker. |
|
13 </p> |
|
14 <h3>Global Attributes</h3> |
|
15 |
|
16 <table> |
|
17 <tr><td>None</td></tr> |
|
18 </table> |
|
19 <h3>Classes</h3> |
|
20 |
|
21 <table> |
|
22 |
|
23 <tr> |
|
24 <td><a href="#SecurityChecker">SecurityChecker</a></td> |
|
25 <td>Class implementing a checker for security issues.</td> |
|
26 </tr> |
|
27 </table> |
|
28 <h3>Functions</h3> |
|
29 |
|
30 <table> |
|
31 <tr><td>None</td></tr> |
|
32 </table> |
|
33 <hr /> |
|
34 <hr /> |
|
35 <a NAME="SecurityChecker" ID="SecurityChecker"></a> |
|
36 <h2>SecurityChecker</h2> |
|
37 |
|
38 <p> |
|
39 Class implementing a checker for security issues. |
|
40 </p> |
|
41 <h3>Derived from</h3> |
|
42 None |
|
43 <h3>Class Attributes</h3> |
|
44 |
|
45 <table> |
|
46 <tr><td>Codes</td></tr> |
|
47 </table> |
|
48 <h3>Class Methods</h3> |
|
49 |
|
50 <table> |
|
51 <tr><td>None</td></tr> |
|
52 </table> |
|
53 <h3>Methods</h3> |
|
54 |
|
55 <table> |
|
56 |
|
57 <tr> |
|
58 <td><a href="#SecurityChecker.__init__">SecurityChecker</a></td> |
|
59 <td>Constructor</td> |
|
60 </tr> |
|
61 <tr> |
|
62 <td><a href="#SecurityChecker.__ignoreCode">__ignoreCode</a></td> |
|
63 <td>Private method to check if the message code should be ignored.</td> |
|
64 </tr> |
|
65 <tr> |
|
66 <td><a href="#SecurityChecker.getConfig">getConfig</a></td> |
|
67 <td>Public method to get the configuration dictionary.</td> |
|
68 </tr> |
|
69 <tr> |
|
70 <td><a href="#SecurityChecker.reportError">reportError</a></td> |
|
71 <td>Public method to record an issue.</td> |
|
72 </tr> |
|
73 <tr> |
|
74 <td><a href="#SecurityChecker.run">run</a></td> |
|
75 <td>Public method to check the given source against security related conditions.</td> |
|
76 </tr> |
|
77 </table> |
|
78 <h3>Static Methods</h3> |
|
79 |
|
80 <table> |
|
81 <tr><td>None</td></tr> |
|
82 </table> |
|
83 |
|
84 <a NAME="SecurityChecker.__init__" ID="SecurityChecker.__init__"></a> |
|
85 <h4>SecurityChecker (Constructor)</h4> |
|
86 <b>SecurityChecker</b>(<i>source, filename, tree, select, ignore, expected, repeat, args</i>) |
|
87 |
|
88 <p> |
|
89 Constructor |
|
90 </p> |
|
91 <dl> |
|
92 |
|
93 <dt><i>source</i> (list of str)</dt> |
|
94 <dd> |
|
95 source code to be checked |
|
96 </dd> |
|
97 <dt><i>filename</i> (str)</dt> |
|
98 <dd> |
|
99 name of the source file |
|
100 </dd> |
|
101 <dt><i>tree</i> (ast.Module)</dt> |
|
102 <dd> |
|
103 AST tree of the source code |
|
104 </dd> |
|
105 <dt><i>select</i> (list of str)</dt> |
|
106 <dd> |
|
107 list of selected codes |
|
108 </dd> |
|
109 <dt><i>ignore</i> (list of str)</dt> |
|
110 <dd> |
|
111 list of codes to be ignored |
|
112 </dd> |
|
113 <dt><i>expected</i> (list of str)</dt> |
|
114 <dd> |
|
115 list of expected codes |
|
116 </dd> |
|
117 <dt><i>repeat</i> (bool)</dt> |
|
118 <dd> |
|
119 flag indicating to report each occurrence of a code |
|
120 </dd> |
|
121 <dt><i>args</i> (dict)</dt> |
|
122 <dd> |
|
123 dictionary of arguments for the security checks |
|
124 </dd> |
|
125 </dl> |
|
126 <a NAME="SecurityChecker.__ignoreCode" ID="SecurityChecker.__ignoreCode"></a> |
|
127 <h4>SecurityChecker.__ignoreCode</h4> |
|
128 <b>__ignoreCode</b>(<i>code</i>) |
|
129 |
|
130 <p> |
|
131 Private method to check if the message code should be ignored. |
|
132 </p> |
|
133 <dl> |
|
134 |
|
135 <dt><i>code</i> (str)</dt> |
|
136 <dd> |
|
137 message code to check for |
|
138 </dd> |
|
139 </dl> |
|
140 <dl> |
|
141 <dt>Return:</dt> |
|
142 <dd> |
|
143 flag indicating to ignore the given code |
|
144 </dd> |
|
145 </dl> |
|
146 <dl> |
|
147 <dt>Return Type:</dt> |
|
148 <dd> |
|
149 bool |
|
150 </dd> |
|
151 </dl> |
|
152 <a NAME="SecurityChecker.getConfig" ID="SecurityChecker.getConfig"></a> |
|
153 <h4>SecurityChecker.getConfig</h4> |
|
154 <b>getConfig</b>(<i></i>) |
|
155 |
|
156 <p> |
|
157 Public method to get the configuration dictionary. |
|
158 </p> |
|
159 <dl> |
|
160 <dt>Return:</dt> |
|
161 <dd> |
|
162 dictionary containing the configuration |
|
163 </dd> |
|
164 </dl> |
|
165 <dl> |
|
166 <dt>Return Type:</dt> |
|
167 <dd> |
|
168 dict |
|
169 </dd> |
|
170 </dl> |
|
171 <a NAME="SecurityChecker.reportError" ID="SecurityChecker.reportError"></a> |
|
172 <h4>SecurityChecker.reportError</h4> |
|
173 <b>reportError</b>(<i>lineNumber, offset, code, severity, confidence, *args</i>) |
|
174 |
|
175 <p> |
|
176 Public method to record an issue. |
|
177 </p> |
|
178 <dl> |
|
179 |
|
180 <dt><i>lineNumber</i> (int)</dt> |
|
181 <dd> |
|
182 line number of the issue |
|
183 </dd> |
|
184 <dt><i>offset</i> (int)</dt> |
|
185 <dd> |
|
186 position within line of the issue |
|
187 </dd> |
|
188 <dt><i>code</i> (str)</dt> |
|
189 <dd> |
|
190 message code |
|
191 </dd> |
|
192 <dt><i>severity</i> (str)</dt> |
|
193 <dd> |
|
194 severity code (H = high, M = medium, L = low, |
|
195 U = undefined) |
|
196 </dd> |
|
197 <dt><i>confidence</i> (str)</dt> |
|
198 <dd> |
|
199 confidence code (H = high, M = medium, L = low, |
|
200 U = undefined) |
|
201 </dd> |
|
202 <dt><i>args</i> (list)</dt> |
|
203 <dd> |
|
204 arguments for the message |
|
205 </dd> |
|
206 </dl> |
|
207 <a NAME="SecurityChecker.run" ID="SecurityChecker.run"></a> |
|
208 <h4>SecurityChecker.run</h4> |
|
209 <b>run</b>(<i></i>) |
|
210 |
|
211 <p> |
|
212 Public method to check the given source against security related |
|
213 conditions. |
|
214 </p> |
|
215 <div align="right"><a href="#top">Up</a></div> |
|
216 <hr /> |
|
217 </body></html> |