Sha256: c68edf010625df84058fe39b26999421685584d47ed8d578dcab4e5662ea7e62
Contents?: true
Size: 824 Bytes
Versions: 64
Compression:
Stored size: 824 Bytes
Contents
module CC module Analyzer class IssueSorter def initialize(issues) @issues = issues end def by_location @issues.sort_by { |i| line_or_offset(i) } end private def line_or_offset(issue) location = issue["location"] case when location["lines"] location["lines"]["begin"].to_i when location["positions"] && location["positions"]["begin"]["line"] location["positions"]["begin"]["line"].to_i + location["positions"]["begin"]["column"].to_i when location["positions"] && location["positions"]["begin"]["offset"] location["positions"]["begin"]["offset"].to_i + 1_000_000_000 # push offsets to end of list else 0 # whole-file issues are first end end end end end
Version data entries
64 entries across 64 versions & 1 rubygems