Commits

Anonymous committed 8a873db

Removed some unused code

Comments (0)

Files changed (1)

             self.dispatch(child)
 
     def visitFunction(self, node):
-        #if not hasattr(node, 'name'): # lambdas
-        #    node.name = '<lambda>'
         score=Complexity(node).score
         stats = Stats(name=node.name,
                       score=score,
                       end_line=self.highest_line_in_node(node))
         self.stats.add(stats)
 
-    #visitLambda = visitFunction
-
     def visitClass(self, node):
         complexity = Complexity(node)
         self.stats.add(Stats(name=node.name,
             repr(self.end_line))
 
 
-def measure_complexity(ast, module_name=None):
-    return CCVisitor(ast, description=module_name).stats
-
-
-class PrettyPrinter(object):
-    def flatten_stats(self, stats):
-        def flatten(stats):
-            for s in stats.classes:
-                name = s.name
-                for x in s.functions:
-                    fname = '.'.join([name, x.name])
-                    yield fname, x.complexity, x.first_line, x.last_line
-            for s in stats.functions:
-                name = s.name
-                yield name, s.complexity, s.first_line, s.last_line
-
-        return [t for t in flatten(stats)]
-
-
 def complexity_name(complexity):
     if complexity > 14:
         return 'high_complexity'