27 @return the entry point for the background client (function) |
27 @return the entry point for the background client (function) |
28 """ |
28 """ |
29 return batchRawCodeMetrics |
29 return batchRawCodeMetrics |
30 |
30 |
31 |
31 |
32 def rawCodeMetrics(file, text=""): |
32 def rawCodeMetrics(file, text=""): # noqa: U100 |
33 """ |
33 """ |
34 Private function to calculate the raw code metrics of one file. |
34 Private function to calculate the raw code metrics of one file. |
35 |
35 |
36 @param file source filename |
36 @param file source filename |
37 @type str |
37 @type str |
38 @param text source text |
38 @param text source text |
39 @type str |
39 @type str |
40 @return tuple containing the result dictionary |
40 @return tuple containing the result dictionary |
41 @rtype (tuple of dict) |
41 @rtype (tuple of dict) |
42 """ |
42 """ |
43 return __rawCodeMetrics(file, text) |
43 return __rawCodeMetrics(text) |
44 |
44 |
45 |
45 |
46 def batchRawCodeMetrics(argumentsList, send, fx, cancelled, maxProcesses=0): |
46 def batchRawCodeMetrics(argumentsList, send, fx, cancelled, maxProcesses=0): |
47 """ |
47 """ |
48 Module function to calculate the raw code metrics for a batch of files. |
48 Module function to calculate the raw code metrics for a batch of files. |
129 @type multiprocessing.Queue |
129 @type multiprocessing.Queue |
130 @param outputQueue output queue |
130 @param outputQueue output queue |
131 @type multiprocessing.Queue |
131 @type multiprocessing.Queue |
132 """ |
132 """ |
133 for filename, source in iter(inputQueue.get, "STOP"): |
133 for filename, source in iter(inputQueue.get, "STOP"): |
134 result = __rawCodeMetrics(filename, source) |
134 result = __rawCodeMetrics(source) |
135 outputQueue.put((filename, result)) |
135 outputQueue.put((filename, result)) |
136 |
136 |
137 |
137 |
138 def __rawCodeMetrics(file, text=""): |
138 def __rawCodeMetrics(text): |
139 """ |
139 """ |
140 Private function to calculate the raw code metrics for one Python file. |
140 Private function to calculate the raw code metrics for one Python file. |
141 |
141 |
142 @param file source filename |
|
143 @type str |
|
144 @param text source text |
142 @param text source text |
145 @type str |
143 @type str |
146 @return tuple containing the result dictionary |
144 @return tuple containing the result dictionary |
147 @rtype (tuple of dict) |
145 @rtype (tuple of dict) |
148 """ |
146 """ |