Sha256: 6f1e4f1b97f35b292a67a1b57a4060c455817b32339a465131859b523cfc991f
Contents?: true
Size: 805 Bytes
Versions: 13
Compression:
Stored size: 805 Bytes
Contents
module CC module Analyzer class EngineOutputFilter ISSUE_TYPE = "issue".freeze def initialize(config = {}) @config = config end def filter?(output) if (json = parse_as_json(output)) issue?(json) && ignore_issue?(json) else false end end private def parse_as_json(output) JSON.parse(output) rescue JSON::ParserError nil end def issue?(json) json["type"] && json["type"].downcase == ISSUE_TYPE end def ignore_issue?(json) !check_config(json["check_name"]).fetch("enabled", true) end def check_config(check_name) @checks ||= @config.fetch("checks", {}) @checks.fetch(check_name, {}) end end end end
Version data entries
13 entries across 13 versions & 1 rubygems