src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Complexity/ComplexityChecker.py

branch
eric7
changeset 10373
093dcebe5ecb
parent 9653
e67609152c5e
child 10439
21c28b0f9e41
--- a/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Complexity/ComplexityChecker.py	Sun Dec 03 16:44:52 2023 +0100
+++ b/src/eric7/Plugins/CheckerPlugins/CodeStyleChecker/Complexity/ComplexityChecker.py	Sun Dec 03 19:46:34 2023 +0100
@@ -213,7 +213,7 @@
         @return sorted list of (line, nodes) tuples
         @rtype list of tuple of (int,int)
         """
-        lst = [(line, self.__count[line]) for line in sorted(self.__count.keys())]
+        lst = [(line, self.__count[line]) for line in sorted(self.__count)]
         return lst
 
     def score(self):
@@ -223,9 +223,8 @@
         @return median line complexity value
         @rtype float
         """
-        lst = self.__count.values()
-        sortedList = sorted(lst)
-        listLength = len(lst)
+        sortedList = sorted(self.__count.values())
+        listLength = len(sortedList)
         medianIndex = (listLength - 1) // 2
 
         if listLength == 0:

eric ide

mercurial