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