ソースを参照

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