eric6/Documentation/Source/eric6.Plugins.CheckerPlugins.CodeStyleChecker.Security.SecurityChecker.html

changeset 7624
6eabbcf3bdf8
child 7989
a21d673a8f99
equal deleted inserted replaced
7623:ddea119f0b1d 7624:6eabbcf3bdf8
1 <!DOCTYPE html>
2 <html><head>
3 <title>eric6.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>eric6.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 object
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.__generateTree">__generateTree</a></td>
77 <td>Private method to generate an AST for our source.</td>
78 </tr>
79 <tr>
80 <td><a href="#SecurityChecker.__ignoreCode">__ignoreCode</a></td>
81 <td>Private method to check if the message code should be ignored.</td>
82 </tr>
83 <tr>
84 <td><a href="#SecurityChecker.__reportInvalidSyntax">__reportInvalidSyntax</a></td>
85 <td>Private method to report a syntax error.</td>
86 </tr>
87 <tr>
88 <td><a href="#SecurityChecker.getConfig">getConfig</a></td>
89 <td>Public method to get the configuration dictionary.</td>
90 </tr>
91 <tr>
92 <td><a href="#SecurityChecker.reportError">reportError</a></td>
93 <td>Public method to record an issue.</td>
94 </tr>
95 <tr>
96 <td><a href="#SecurityChecker.run">run</a></td>
97 <td>Public method to check the given source against security related conditions.</td>
98 </tr>
99 </table>
100 <h3>Static Methods</h3>
101
102 <table>
103 <tr><td>None</td></tr>
104 </table>
105
106 <a NAME="SecurityChecker.__init__" ID="SecurityChecker.__init__"></a>
107 <h4>SecurityChecker (Constructor)</h4>
108 <b>SecurityChecker</b>(<i>source, filename, select, ignore, expected, repeat, args</i>)
109
110 <p>
111 Constructor
112 </p>
113 <dl>
114
115 <dt><i>source</i> (list of str)</dt>
116 <dd>
117 source code to be checked
118 </dd>
119 <dt><i>filename</i> (str)</dt>
120 <dd>
121 name of the source file
122 </dd>
123 <dt><i>select</i> (list of str)</dt>
124 <dd>
125 list of selected codes
126 </dd>
127 <dt><i>ignore</i> (list of str)</dt>
128 <dd>
129 list of codes to be ignored
130 </dd>
131 <dt><i>expected</i> (list of str)</dt>
132 <dd>
133 list of expected codes
134 </dd>
135 <dt><i>repeat</i> (bool)</dt>
136 <dd>
137 flag indicating to report each occurrence of a code
138 </dd>
139 <dt><i>args</i> (dict)</dt>
140 <dd>
141 dictionary of arguments for the security checks
142 </dd>
143 </dl>
144 <a NAME="SecurityChecker.__generateTree" ID="SecurityChecker.__generateTree"></a>
145 <h4>SecurityChecker.__generateTree</h4>
146 <b>__generateTree</b>(<i></i>)
147
148 <p>
149 Private method to generate an AST for our source.
150 </p>
151 <dl>
152 <dt>Returns:</dt>
153 <dd>
154 generated AST
155 </dd>
156 </dl>
157 <dl>
158 <dt>Return Type:</dt>
159 <dd>
160 ast.AST
161 </dd>
162 </dl>
163 <a NAME="SecurityChecker.__ignoreCode" ID="SecurityChecker.__ignoreCode"></a>
164 <h4>SecurityChecker.__ignoreCode</h4>
165 <b>__ignoreCode</b>(<i>code</i>)
166
167 <p>
168 Private method to check if the message code should be ignored.
169 </p>
170 <dl>
171
172 <dt><i>code</i> (str)</dt>
173 <dd>
174 message code to check for
175 </dd>
176 </dl>
177 <dl>
178 <dt>Returns:</dt>
179 <dd>
180 flag indicating to ignore the given code
181 </dd>
182 </dl>
183 <dl>
184 <dt>Return Type:</dt>
185 <dd>
186 bool
187 </dd>
188 </dl>
189 <a NAME="SecurityChecker.__reportInvalidSyntax" ID="SecurityChecker.__reportInvalidSyntax"></a>
190 <h4>SecurityChecker.__reportInvalidSyntax</h4>
191 <b>__reportInvalidSyntax</b>(<i></i>)
192
193 <p>
194 Private method to report a syntax error.
195 </p>
196 <a NAME="SecurityChecker.getConfig" ID="SecurityChecker.getConfig"></a>
197 <h4>SecurityChecker.getConfig</h4>
198 <b>getConfig</b>(<i></i>)
199
200 <p>
201 Public method to get the configuration dictionary.
202 </p>
203 <dl>
204 <dt>Returns:</dt>
205 <dd>
206 dictionary containing the configuration
207 </dd>
208 </dl>
209 <dl>
210 <dt>Return Type:</dt>
211 <dd>
212 dict
213 </dd>
214 </dl>
215 <a NAME="SecurityChecker.reportError" ID="SecurityChecker.reportError"></a>
216 <h4>SecurityChecker.reportError</h4>
217 <b>reportError</b>(<i>lineNumber, offset, code, severity, confidence, *args</i>)
218
219 <p>
220 Public method to record an issue.
221 </p>
222 <dl>
223
224 <dt><i>lineNumber</i> (int)</dt>
225 <dd>
226 line number of the issue
227 </dd>
228 <dt><i>offset</i> (int)</dt>
229 <dd>
230 position within line of the issue
231 </dd>
232 <dt><i>code</i> (str)</dt>
233 <dd>
234 message code
235 </dd>
236 <dt><i>severity</i> (str)</dt>
237 <dd>
238 severity code (H = high, M = medium, L = low,
239 U = undefined)
240 </dd>
241 <dt><i>confidence</i> (str)</dt>
242 <dd>
243 confidence code (H = high, M = medium, L = low,
244 U = undefined)
245 </dd>
246 <dt><i>args</i> (list)</dt>
247 <dd>
248 arguments for the message
249 </dd>
250 </dl>
251 <a NAME="SecurityChecker.run" ID="SecurityChecker.run"></a>
252 <h4>SecurityChecker.run</h4>
253 <b>run</b>(<i></i>)
254
255 <p>
256 Public method to check the given source against security related
257 conditions.
258 </p>
259 <div align="right"><a href="#top">Up</a></div>
260 <hr />
261 </body></html>

eric ide

mercurial