Sha256: 9eaaa8623dc5b6f97893cd55a1a98326ce14cd445ebe4e534c62fde4789705c9
Contents?: true
Size: 740 Bytes
Versions: 7
Compression:
Stored size: 740 Bytes
Contents
module Warder # responsible for run code complexity validation class CodeComplexityRunner < Runner CLI_OPTION = 'c' CLI_FULL_OPTION = 'code-complexity' DESCRIPTION = 'Run code complexity validation' COMMAND_NAME = 'flog' FLOG_SCORE = SCORE FAILURE_REGEXP = /^\s+(\d+.\d+)\:\s.*$/ TOTAL_REGEXP = /^\s+\d+.\d+\:.*(total|average)$/ private def command_with_options "#{COMMAND_NAME} -a -c -g -m #{@options.files}" end def failed?(line) match = FAILURE_REGEXP.match(line) return false if total?(line) match && match[1].to_f > FLOG_SCORE end def printable?(line) failed?(line) end def total?(line) TOTAL_REGEXP.match(line) end end end
Version data entries
7 entries across 7 versions & 1 rubygems