76 self.filterFrame.setVisible(False) |
76 self.filterFrame.setVisible(False) |
77 |
77 |
78 self.explanationLabel.setText(self.tr( |
78 self.explanationLabel.setText(self.tr( |
79 "<table>" |
79 "<table>" |
80 "<tr><td><b>LOC</b></td>" |
80 "<tr><td><b>LOC</b></td>" |
81 "<td>Lines of code (LOC = SLOC + Empty)</td></tr>" |
81 "<td>Lines of code</td></tr>" |
82 "<tr><td><b>SLOC</b></td><td>Source lines of code</td></tr>" |
82 "<tr><td><b>SLOC</b></td><td>Source lines of code</td></tr>" |
83 "<tr><td><b>LLOC</b></td><td>Logical lines of code</td></tr>" |
83 "<tr><td><b>LLOC</b></td><td>Logical lines of code</td></tr>" |
84 "<tr><td><b>Comments</b></td><td>Comment lines</td></tr>" |
84 "<tr><td><b>Comments</b></td><td>Comment lines</td></tr>" |
85 "<tr><td><b>Empty Comments</b></td><td>Comment lines not" |
85 "<tr><td><b>Empty Comments</b></td><td>Comment lines not" |
86 " containing code</td></tr>" |
86 " containing code</td></tr>" |
116 for value in self.__getValues(values): |
116 for value in self.__getValues(values): |
117 try: |
117 try: |
118 data.append("{0:5}".format(int(value))) |
118 data.append("{0:5}".format(int(value))) |
119 except ValueError: |
119 except ValueError: |
120 data.append(value) |
120 data.append(value) |
121 data.append("{0:3.0%}".format( |
121 data.append("{0:3.0%}".format(min( |
122 values["comments"] / (float(values["loc"]) or 1))) |
122 values["comments"] / (float(values["loc"]) or 1), |
123 data.append("{0:3.0%}".format( |
123 1.0))) |
124 values["comments"] / (float(values["sloc"]) or 1))) |
124 data.append("{0:3.0%}".format(min( |
125 data.append("{0:3.0%}".format( |
125 values["comments"] / (float(values["sloc"]) or 1), |
|
126 1.0))) |
|
127 data.append("{0:3.0%}".format(min( |
126 (values["comments"] + values["multi"]) / |
128 (values["comments"] + values["multi"]) / |
127 (float(values["loc"]) or 1))) |
129 (float(values["loc"]) or 1), |
|
130 1.0))) |
128 itm = QTreeWidgetItem(self.resultList, data) |
131 itm = QTreeWidgetItem(self.resultList, data) |
129 for col in range(1, 10): |
132 for col in range(1, 10): |
130 itm.setTextAlignment(col, Qt.Alignment(Qt.AlignRight)) |
133 itm.setTextAlignment(col, Qt.Alignment(Qt.AlignRight)) |
131 itm.setData(0, self.FilePathRole, filename) |
134 itm.setData(0, self.FilePathRole, filename) |
132 |
135 |