RadonMetrics/MaintainabilityIndexCalculator.py

branch
eric7
changeset 107
0843dd7239f6
parent 106
6422943b388f
child 109
47df4b69f699
equal deleted inserted replaced
106:6422943b388f 107:0843dd7239f6
27 @return the entry point for the background client (function) 27 @return the entry point for the background client (function)
28 """ 28 """
29 return batchMaintainabilityIndex 29 return batchMaintainabilityIndex
30 30
31 31
32 def maintainabilityIndex(file, text=""): 32 def maintainabilityIndex(file, text=""): # noqa: U100
33 """ 33 """
34 Private function to calculate the maintainability index of one file. 34 Private function to calculate the maintainability index 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 __maintainabilityIndex(file, text) 43 return __maintainabilityIndex(text)
44 44
45 45
46 def batchMaintainabilityIndex(argumentsList, send, fx, cancelled, maxProcesses=0): 46 def batchMaintainabilityIndex(argumentsList, send, fx, cancelled, maxProcesses=0):
47 """ 47 """
48 Module function to calculate the maintainability index for a batch of 48 Module function to calculate the maintainability index for a batch of
131 @type multiprocessing.Queue 131 @type multiprocessing.Queue
132 @param outputQueue output queue 132 @param outputQueue output queue
133 @type multiprocessing.Queue 133 @type multiprocessing.Queue
134 """ 134 """
135 for filename, source in iter(inputQueue.get, "STOP"): 135 for filename, source in iter(inputQueue.get, "STOP"):
136 result = __maintainabilityIndex(filename, source) 136 result = __maintainabilityIndex(source)
137 outputQueue.put((filename, result)) 137 outputQueue.put((filename, result))
138 138
139 139
140 def __maintainabilityIndex(file, text=""): 140 def __maintainabilityIndex(text):
141 """ 141 """
142 Private function to calculate the maintainability index for one Python 142 Private function to calculate the maintainability index for one Python
143 file. 143 file.
144 144
145 @param file source filename
146 @type str
147 @param text source text 145 @param text source text
148 @type str 146 @type str
149 @return tuple containing the result dictionary 147 @return tuple containing the result dictionary
150 @rtype (tuple of dict) 148 @rtype (tuple of dict)
151 """ 149 """

eric ide

mercurial