RadonMetrics/CyclomaticComplexityCalculator.py

branch
eric7
changeset 104
6eac83394939
parent 94
725eaca7bc4b
child 106
6422943b388f
equal deleted inserted replaced
103:3fcdd23d144d 104:6eac83394939
5 5
6 """ 6 """
7 Module implementing the cyclomatic complexity service. 7 Module implementing the cyclomatic complexity service.
8 """ 8 """
9 9
10 import multiprocessing
10 import queue 11 import queue
11 import multiprocessing
12 12
13 13
14 def initService(): 14 def initService():
15 """ 15 """
16 Initialize the service and return the entry point. 16 Initialize the service and return the entry point.
147 @param text source text 147 @param text source text
148 @type str 148 @type str
149 @return tuple containing the result dictionary 149 @return tuple containing the result dictionary
150 @rtype (tuple of dict) 150 @rtype (tuple of dict)
151 """ 151 """
152 from radon.complexity import cc_visit, cc_rank 152 from radon.complexity import cc_rank, cc_visit
153 153
154 try: 154 try:
155 cc = cc_visit(text) 155 cc = cc_visit(text)
156 res = {"result": [v for v in map(__cc2Dict, cc) if v["type"] != "method"]} 156 res = {"result": [v for v in map(__cc2Dict, cc) if v["type"] != "method"]}
157 totalCC = 0 157 totalCC = 0

eric ide

mercurial