16 |
16 |
17 a { color: #BA6D36; } |
17 a { color: #BA6D36; } |
18 |
18 |
19 </style> |
19 </style> |
20 </head> |
20 </head> |
21 <body><a NAME="top" ID="top"></a> |
21 <body> |
|
22 <a NAME="top" ID="top"></a> |
22 <h1>Plugin_Metrics_Radon.RadonMetrics.CyclomaticComplexityCalculator</h1> |
23 <h1>Plugin_Metrics_Radon.RadonMetrics.CyclomaticComplexityCalculator</h1> |
|
24 |
23 <p> |
25 <p> |
24 Module implementing the cyclomatic complexity service. |
26 Module implementing the cyclomatic complexity service. |
25 </p> |
27 </p> |
26 <h3>Global Attributes</h3> |
28 <h3>Global Attributes</h3> |
|
29 |
27 <table> |
30 <table> |
28 <tr><td>None</td></tr> |
31 <tr><td>None</td></tr> |
29 </table> |
32 </table> |
30 <h3>Classes</h3> |
33 <h3>Classes</h3> |
|
34 |
31 <table> |
35 <table> |
32 <tr><td>None</td></tr> |
36 <tr><td>None</td></tr> |
33 </table> |
37 </table> |
34 <h3>Functions</h3> |
38 <h3>Functions</h3> |
|
39 |
35 <table> |
40 <table> |
|
41 |
36 <tr> |
42 <tr> |
37 <td><a href="#__cc2Dict">__cc2Dict</a></td> |
43 <td><a href="#__cc2Dict">__cc2Dict</a></td> |
38 <td>Private function to convert an object holding cyclomatic complexity results into a dictionary.</td> |
44 <td>Private function to convert an object holding cyclomatic complexity results into a dictionary.</td> |
39 </tr><tr> |
45 </tr> |
|
46 <tr> |
40 <td><a href="#__cyclomaticComplexity">__cyclomaticComplexity</a></td> |
47 <td><a href="#__cyclomaticComplexity">__cyclomaticComplexity</a></td> |
41 <td>Private function to calculate the cyclomatic complexity for one Python file.</td> |
48 <td>Private function to calculate the cyclomatic complexity for one Python file.</td> |
42 </tr><tr> |
49 </tr> |
|
50 <tr> |
43 <td><a href="#__getType">__getType</a></td> |
51 <td><a href="#__getType">__getType</a></td> |
44 <td>Private function to get the type of an object as a string.</td> |
52 <td>Private function to get the type of an object as a string.</td> |
45 </tr><tr> |
53 </tr> |
|
54 <tr> |
46 <td><a href="#batchCyclomaticComplexity">batchCyclomaticComplexity</a></td> |
55 <td><a href="#batchCyclomaticComplexity">batchCyclomaticComplexity</a></td> |
47 <td>Module function to calculate the cyclomatic complexity for a batch of files.</td> |
56 <td>Module function to calculate the cyclomatic complexity for a batch of files.</td> |
48 </tr><tr> |
57 </tr> |
|
58 <tr> |
49 <td><a href="#cyclomaticComplexity">cyclomaticComplexity</a></td> |
59 <td><a href="#cyclomaticComplexity">cyclomaticComplexity</a></td> |
50 <td>Private function to calculate the cyclomatic complexity of one file.</td> |
60 <td>Private function to calculate the cyclomatic complexity of one file.</td> |
51 </tr><tr> |
61 </tr> |
|
62 <tr> |
52 <td><a href="#initBatchService">initBatchService</a></td> |
63 <td><a href="#initBatchService">initBatchService</a></td> |
53 <td>Initialize the batch service and return the entry point.</td> |
64 <td>Initialize the batch service and return the entry point.</td> |
54 </tr><tr> |
65 </tr> |
|
66 <tr> |
55 <td><a href="#initService">initService</a></td> |
67 <td><a href="#initService">initService</a></td> |
56 <td>Initialize the service and return the entry point.</td> |
68 <td>Initialize the service and return the entry point.</td> |
57 </tr><tr> |
69 </tr> |
|
70 <tr> |
58 <td><a href="#worker">worker</a></td> |
71 <td><a href="#worker">worker</a></td> |
59 <td>Module function acting as the parallel worker for the cyclomatic complexity calculation.</td> |
72 <td>Module function acting as the parallel worker for the cyclomatic complexity calculation.</td> |
60 </tr> |
73 </tr> |
61 </table> |
74 </table> |
62 <hr /><hr /> |
75 <hr /> |
|
76 <hr /> |
63 <a NAME="__cc2Dict" ID="__cc2Dict"></a> |
77 <a NAME="__cc2Dict" ID="__cc2Dict"></a> |
64 <h2>__cc2Dict</h2> |
78 <h2>__cc2Dict</h2> |
65 <b>__cc2Dict</b>(<i>obj</i>) |
79 <b>__cc2Dict</b>(<i>obj</i>) |
|
80 |
66 <p> |
81 <p> |
67 Private function to convert an object holding cyclomatic complexity results |
82 Private function to convert an object holding cyclomatic complexity results |
68 into a dictionary. |
83 into a dictionary. |
69 </p><dl> |
84 </p> |
|
85 <dl> |
|
86 |
70 <dt><i>obj</i> (radon.visitors.Function)</dt> |
87 <dt><i>obj</i> (radon.visitors.Function)</dt> |
71 <dd> |
88 <dd> |
72 object as returned from cc_visit() |
89 object as returned from cc_visit() |
73 </dd> |
90 </dd> |
74 </dl><dl> |
91 </dl> |
|
92 <dl> |
75 <dt>Returns:</dt> |
93 <dt>Returns:</dt> |
76 <dd> |
94 <dd> |
77 conversion result |
95 conversion result |
78 </dd> |
96 </dd> |
79 </dl><dl> |
97 </dl> |
|
98 <dl> |
80 <dt>Return Type:</dt> |
99 <dt>Return Type:</dt> |
81 <dd> |
100 <dd> |
82 dict |
101 dict |
83 </dd> |
102 </dd> |
84 </dl> |
103 </dl> |
85 <div align="right"><a href="#top">Up</a></div> |
104 <div align="right"><a href="#top">Up</a></div> |
86 <hr /><hr /> |
105 <hr /> |
|
106 <hr /> |
87 <a NAME="__cyclomaticComplexity" ID="__cyclomaticComplexity"></a> |
107 <a NAME="__cyclomaticComplexity" ID="__cyclomaticComplexity"></a> |
88 <h2>__cyclomaticComplexity</h2> |
108 <h2>__cyclomaticComplexity</h2> |
89 <b>__cyclomaticComplexity</b>(<i>file, text=""</i>) |
109 <b>__cyclomaticComplexity</b>(<i>file, text=""</i>) |
|
110 |
90 <p> |
111 <p> |
91 Private function to calculate the cyclomatic complexity for one Python |
112 Private function to calculate the cyclomatic complexity for one Python |
92 file. |
113 file. |
93 </p><dl> |
114 </p> |
|
115 <dl> |
|
116 |
94 <dt><i>file</i> (str)</dt> |
117 <dt><i>file</i> (str)</dt> |
95 <dd> |
118 <dd> |
96 source filename |
119 source filename |
97 </dd><dt><i>text</i> (str)</dt> |
120 </dd> |
|
121 <dt><i>text</i> (str)</dt> |
98 <dd> |
122 <dd> |
99 source text |
123 source text |
100 </dd> |
124 </dd> |
101 </dl><dl> |
125 </dl> |
|
126 <dl> |
102 <dt>Returns:</dt> |
127 <dt>Returns:</dt> |
103 <dd> |
128 <dd> |
104 tuple containing the result dictionary |
129 tuple containing the result dictionary |
105 </dd> |
130 </dd> |
106 </dl><dl> |
131 </dl> |
|
132 <dl> |
107 <dt>Return Type:</dt> |
133 <dt>Return Type:</dt> |
108 <dd> |
134 <dd> |
109 (tuple of dict) |
135 (tuple of dict) |
110 </dd> |
136 </dd> |
111 </dl> |
137 </dl> |
112 <div align="right"><a href="#top">Up</a></div> |
138 <div align="right"><a href="#top">Up</a></div> |
113 <hr /><hr /> |
139 <hr /> |
|
140 <hr /> |
114 <a NAME="__getType" ID="__getType"></a> |
141 <a NAME="__getType" ID="__getType"></a> |
115 <h2>__getType</h2> |
142 <h2>__getType</h2> |
116 <b>__getType</b>(<i>obj</i>) |
143 <b>__getType</b>(<i>obj</i>) |
|
144 |
117 <p> |
145 <p> |
118 Private function to get the type of an object as a string. |
146 Private function to get the type of an object as a string. |
119 </p><dl> |
147 </p> |
|
148 <dl> |
|
149 |
120 <dt><i>obj</i> (radon.visitors.Function or radon.visitors.Class)</dt> |
150 <dt><i>obj</i> (radon.visitors.Function or radon.visitors.Class)</dt> |
121 <dd> |
151 <dd> |
122 object to be analyzed |
152 object to be analyzed |
123 </dd> |
153 </dd> |
124 </dl><dl> |
154 </dl> |
|
155 <dl> |
125 <dt>Returns:</dt> |
156 <dt>Returns:</dt> |
126 <dd> |
157 <dd> |
127 type string for the object |
158 type string for the object |
128 </dd> |
159 </dd> |
129 </dl><dl> |
160 </dl> |
|
161 <dl> |
130 <dt>Return Type:</dt> |
162 <dt>Return Type:</dt> |
131 <dd> |
163 <dd> |
132 str, one of ["method", "function", "class"] |
164 str, one of ["method", "function", "class"] |
133 </dd> |
165 </dd> |
134 </dl> |
166 </dl> |
135 <div align="right"><a href="#top">Up</a></div> |
167 <div align="right"><a href="#top">Up</a></div> |
136 <hr /><hr /> |
168 <hr /> |
|
169 <hr /> |
137 <a NAME="batchCyclomaticComplexity" ID="batchCyclomaticComplexity"></a> |
170 <a NAME="batchCyclomaticComplexity" ID="batchCyclomaticComplexity"></a> |
138 <h2>batchCyclomaticComplexity</h2> |
171 <h2>batchCyclomaticComplexity</h2> |
139 <b>batchCyclomaticComplexity</b>(<i>argumentsList, send, fx, cancelled, maxProcesses=0</i>) |
172 <b>batchCyclomaticComplexity</b>(<i>argumentsList, send, fx, cancelled, maxProcesses=0</i>) |
|
173 |
140 <p> |
174 <p> |
141 Module function to calculate the cyclomatic complexity for a batch of |
175 Module function to calculate the cyclomatic complexity for a batch of |
142 files. |
176 files. |
143 </p><dl> |
177 </p> |
|
178 <dl> |
|
179 |
144 <dt><i>argumentsList</i> (list)</dt> |
180 <dt><i>argumentsList</i> (list)</dt> |
145 <dd> |
181 <dd> |
146 list of arguments tuples as given for |
182 list of arguments tuples as given for |
147 cyclomaticComplexity |
183 cyclomaticComplexity |
148 </dd><dt><i>send</i> (function)</dt> |
184 </dd> |
|
185 <dt><i>send</i> (function)</dt> |
149 <dd> |
186 <dd> |
150 reference to send function |
187 reference to send function |
151 </dd><dt><i>fx</i> (str)</dt> |
188 </dd> |
|
189 <dt><i>fx</i> (str)</dt> |
152 <dd> |
190 <dd> |
153 registered service name |
191 registered service name |
154 </dd><dt><i>cancelled</i> (function)</dt> |
192 </dd> |
|
193 <dt><i>cancelled</i> (function)</dt> |
155 <dd> |
194 <dd> |
156 reference to function checking for a cancellation |
195 reference to function checking for a cancellation |
157 </dd><dt><i>maxProcesses</i> (int)</dt> |
196 </dd> |
|
197 <dt><i>maxProcesses</i> (int)</dt> |
158 <dd> |
198 <dd> |
159 number of processes to be used |
199 number of processes to be used |
160 </dd> |
200 </dd> |
161 </dl> |
201 </dl> |
162 <div align="right"><a href="#top">Up</a></div> |
202 <div align="right"><a href="#top">Up</a></div> |
163 <hr /><hr /> |
203 <hr /> |
|
204 <hr /> |
164 <a NAME="cyclomaticComplexity" ID="cyclomaticComplexity"></a> |
205 <a NAME="cyclomaticComplexity" ID="cyclomaticComplexity"></a> |
165 <h2>cyclomaticComplexity</h2> |
206 <h2>cyclomaticComplexity</h2> |
166 <b>cyclomaticComplexity</b>(<i>file, text=""</i>) |
207 <b>cyclomaticComplexity</b>(<i>file, text=""</i>) |
|
208 |
167 <p> |
209 <p> |
168 Private function to calculate the cyclomatic complexity of one file. |
210 Private function to calculate the cyclomatic complexity of one file. |
169 </p><dl> |
211 </p> |
|
212 <dl> |
|
213 |
170 <dt><i>file</i> (str)</dt> |
214 <dt><i>file</i> (str)</dt> |
171 <dd> |
215 <dd> |
172 source filename |
216 source filename |
173 </dd><dt><i>text</i> (str)</dt> |
217 </dd> |
|
218 <dt><i>text</i> (str)</dt> |
174 <dd> |
219 <dd> |
175 source text |
220 source text |
176 </dd> |
221 </dd> |
177 </dl><dl> |
222 </dl> |
|
223 <dl> |
178 <dt>Returns:</dt> |
224 <dt>Returns:</dt> |
179 <dd> |
225 <dd> |
180 tuple containing the result dictionary |
226 tuple containing the result dictionary |
181 </dd> |
227 </dd> |
182 </dl><dl> |
228 </dl> |
|
229 <dl> |
183 <dt>Return Type:</dt> |
230 <dt>Return Type:</dt> |
184 <dd> |
231 <dd> |
185 (tuple of dict) |
232 (tuple of dict) |
186 </dd> |
233 </dd> |
187 </dl> |
234 </dl> |
188 <div align="right"><a href="#top">Up</a></div> |
235 <div align="right"><a href="#top">Up</a></div> |
189 <hr /><hr /> |
236 <hr /> |
|
237 <hr /> |
190 <a NAME="initBatchService" ID="initBatchService"></a> |
238 <a NAME="initBatchService" ID="initBatchService"></a> |
191 <h2>initBatchService</h2> |
239 <h2>initBatchService</h2> |
192 <b>initBatchService</b>(<i></i>) |
240 <b>initBatchService</b>(<i></i>) |
|
241 |
193 <p> |
242 <p> |
194 Initialize the batch service and return the entry point. |
243 Initialize the batch service and return the entry point. |
195 </p><dl> |
244 </p> |
|
245 <dl> |
196 <dt>Returns:</dt> |
246 <dt>Returns:</dt> |
197 <dd> |
247 <dd> |
198 the entry point for the background client (function) |
248 the entry point for the background client (function) |
199 </dd> |
249 </dd> |
200 </dl> |
250 </dl> |
201 <div align="right"><a href="#top">Up</a></div> |
251 <div align="right"><a href="#top">Up</a></div> |
202 <hr /><hr /> |
252 <hr /> |
|
253 <hr /> |
203 <a NAME="initService" ID="initService"></a> |
254 <a NAME="initService" ID="initService"></a> |
204 <h2>initService</h2> |
255 <h2>initService</h2> |
205 <b>initService</b>(<i></i>) |
256 <b>initService</b>(<i></i>) |
|
257 |
206 <p> |
258 <p> |
207 Initialize the service and return the entry point. |
259 Initialize the service and return the entry point. |
208 </p><dl> |
260 </p> |
|
261 <dl> |
209 <dt>Returns:</dt> |
262 <dt>Returns:</dt> |
210 <dd> |
263 <dd> |
211 the entry point for the background client (function) |
264 the entry point for the background client (function) |
212 </dd> |
265 </dd> |
213 </dl> |
266 </dl> |
214 <div align="right"><a href="#top">Up</a></div> |
267 <div align="right"><a href="#top">Up</a></div> |
215 <hr /><hr /> |
268 <hr /> |
|
269 <hr /> |
216 <a NAME="worker" ID="worker"></a> |
270 <a NAME="worker" ID="worker"></a> |
217 <h2>worker</h2> |
271 <h2>worker</h2> |
218 <b>worker</b>(<i>inputQueue, outputQueue</i>) |
272 <b>worker</b>(<i>inputQueue, outputQueue</i>) |
|
273 |
219 <p> |
274 <p> |
220 Module function acting as the parallel worker for the cyclomatic |
275 Module function acting as the parallel worker for the cyclomatic |
221 complexity calculation. |
276 complexity calculation. |
222 </p><dl> |
277 </p> |
|
278 <dl> |
|
279 |
223 <dt><i>inputQueue</i> (multiprocessing.Queue)</dt> |
280 <dt><i>inputQueue</i> (multiprocessing.Queue)</dt> |
224 <dd> |
281 <dd> |
225 input queue |
282 input queue |
226 </dd><dt><i>outputQueue</i> (multiprocessing.Queue)</dt> |
283 </dd> |
|
284 <dt><i>outputQueue</i> (multiprocessing.Queue)</dt> |
227 <dd> |
285 <dd> |
228 output queue |
286 output queue |
229 </dd> |
287 </dd> |
230 </dl> |
288 </dl> |
231 <div align="right"><a href="#top">Up</a></div> |
289 <div align="right"><a href="#top">Up</a></div> |