lib/warder/code_complexity_runner.rb in warder-0.1.0 vs lib/warder/code_complexity_runner.rb in warder-0.1.1
- old
+ new
@@ -12,11 +12,19 @@
def command
"flog -a -c -g -m #{@options.files}"
end
def failed?(line)
- match = line.match(/^\s+(\d+.\d):\s+(.*)$/)
+ match = line.match(/^\s+(\d+.\d+)\:\s.*$/)
+ return false if total?(line)
+ match && match[1].to_f > FLOG_SCORE
+ end
- match && match[1].to_f > FLOG_SCORE && !match[2].match(/^flog/)
+ def printable?(line)
+ failed?(line)
+ end
+
+ def total?(line)
+ line.match(/^\s+\d+.\d+\:.*(total|average)$/)
end
end
end