lib/sarif/base_sarif.rb
# Returns the 'runs' object for a supported/unsupported scanner's report
Returns the 'runs' object for a supported/unsupported scanner's report
Returns the ' runs ' object for a supported / unsupported scanner ' s report
def build_runs_object(supported)
      results = []
      rules = []
      @logs.each do |issue|
        parsed_issue = parse_issue(issue)
        next if !parsed_issue
        next if parsed_issue[:suppressed] && @config['include_suppressed'] == false
        next if @required == false && @config['include_suppressed'] == false
        rule = build_rule(parsed_issue)
        rules << rule if rule
        result = build_result(parsed_issue)
        if parsed_issue[:suppressed] || @required == false
          result['suppressions'] = [{
            'kind': 'external'
          }]
        end
        results << result
      end
      results = results.each_with_object([]) { |h, result| result << h unless result.include?(h); }
      invocation = build_invocations(@scan_report, supported)
      {
        "tool" => build_tool(rules: rules),
        "conversion" => build_conversion,
        "results" => results,
        "invocations" => [invocation]
      }
    end
def build_runs_object ( supported ) results = [ ] rules = [ ] @logs . each do | issue | parsed_issue = parse_issue ( issue ) next if ! parsed_issue next if parsed_issue [ :suppressed ] && @config [ 'include_suppressed' ] == false next if @required == false && @config [ 'include_suppressed' ] == false rule = build_rule ( parsed_issue ) rules << rule if rule result = build_result ( parsed_issue ) if parsed_issue [ :suppressed ] || @required == false result [ 'suppressions' ] = [ { 'kind' : 'external' } ] end results << result end results = results . each_with_object ( [ ] ) { | h , result | result << h unless result . include? ( h ) ; } invocation = build_invocations ( @scan_report , supported ) { "tool" => build_tool ( rules : rules ) , "conversion" => build_conversion , "results" => results , "invocations" => [ invocation ] } end
Returns the 'runs' object for a supported/unsupported scanner's report
Returns the ' runs ' object for a supported / unsupported scanner ' s report
# Add suppresion object for suppressed results # unique-ify the results
supported
<not_specific>