Преглед на файлове

solve bug on python 2.7 for std.code.ratio.comments

Emmanuel Olivi преди 3 години
родител
ревизия
f7a495841f
променени са 1 файла, в които са добавени 3 реда и са изтрити 2 реда
  1. 3 2
      metrixpp/mpp/api.py

+ 3 - 2
metrixpp/mpp/api.py

@@ -1182,9 +1182,10 @@ class MetricPluginMixin(Parent):
                 and
                 (sourced_divisor != None)
                 and
-                (sourced_dividend + sourced_divisor != 0)
+                (sourced_divisor != 0)
                ):
-                self.result = sourced_dividend / (sourced_divisor + sourced_dividend)
+                # define as the number of lines of comments by the number of lines of code
+                self.result = float(sourced_dividend) / sourced_divisor
             else:
               self.result = 0.0