Explorar o código

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

Emmanuel Olivi %!s(int64=3) %!d(string=hai) anos
pai
achega
f7a495841f
Modificáronse 1 ficheiros con 3 adicións e 2 borrados
  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