RadonMetrics/CyclomaticComplexityDialog.py

changeset 69
cdf51e6abaee
parent 68
69445de59a30
child 71
1e69db534be1
equal deleted inserted replaced
68:69445de59a30 69:cdf51e6abaee
5 5
6 """ 6 """
7 Module implementing a dialog to show the cyclomatic complexity (McCabe 7 Module implementing a dialog to show the cyclomatic complexity (McCabe
8 complexity). 8 complexity).
9 """ 9 """
10
11 from __future__ import unicode_literals
12
13 try:
14 str = unicode # __IGNORE_EXCEPTION__ __IGNORE_WARNING__
15 except NameError:
16 pass
17 10
18 import os 11 import os
19 import fnmatch 12 import fnmatch
20 import sys 13 import sys
21 14
308 self.checkProgressLabel.setVisible(len(self.files) > 1) 301 self.checkProgressLabel.setVisible(len(self.files) > 1)
309 QApplication.processEvents() 302 QApplication.processEvents()
310 303
311 # now go through all the files 304 # now go through all the files
312 self.progress = 0 305 self.progress = 0
313 if len(self.files) == 1 or not self.radonService.hasBatch: 306 if len(self.files) == 1:
314 self.__batch = False 307 self.__batch = False
315 self.cyclomaticComplexity() 308 self.cyclomaticComplexity()
316 else: 309 else:
317 self.__batch = True 310 self.__batch = True
318 self.cyclomaticComplexityBatch() 311 self.cyclomaticComplexityBatch()
551 """ 544 """
552 fileList = self.__fileList[:] 545 fileList = self.__fileList[:]
553 dataChanged = False 546 dataChanged = False
554 547
555 filterString = self.excludeFilesEdit.text() 548 filterString = self.excludeFilesEdit.text()
556 if "ExcludeFiles" not in self.__data or \ 549 if (
557 filterString != self.__data["ExcludeFiles"]: 550 "ExcludeFiles" not in self.__data or
551 filterString != self.__data["ExcludeFiles"]
552 ):
558 self.__data["ExcludeFiles"] = filterString 553 self.__data["ExcludeFiles"] = filterString
559 dataChanged = True 554 dataChanged = True
560 filterList = [f.strip() for f in filterString.split(",") 555 filterList = [f.strip() for f in filterString.split(",")
561 if f.strip()] 556 if f.strip()]
562 if filterList: 557 if filterList:
563 for fileFilter in filterList: 558 for fileFilter in filterList:
564 fileList = \ 559 fileList = [f for f in fileList
565 [f for f in fileList if not fnmatch.fnmatch(f, fileFilter)] 560 if not fnmatch.fnmatch(f, fileFilter)]
566 561
567 minimumRank = self.rankComboBox.currentText() 562 minimumRank = self.rankComboBox.currentText()
568 if "MinimumRank" not in self.__data or \ 563 if (
569 minimumRank != self.__data["MinimumRank"]: 564 "MinimumRank" not in self.__data or
565 minimumRank != self.__data["MinimumRank"]
566 ):
570 self.__data["MinimumRank"] = minimumRank 567 self.__data["MinimumRank"] = minimumRank
571 dataChanged = True 568 dataChanged = True
572 569
573 if dataChanged: 570 if dataChanged:
574 self.__project.setData( 571 self.__project.setData(

eric ide

mercurial