class RuboCop::CachedData

def serialize_offense(offense)

def serialize_offense(offense)
  status = :uncorrected if %i[corrected corrected_with_todo].include?(offense.status)
  {
    # Calling #to_s here ensures that the serialization works when using
    # other json serializers such as Oj. Some of these gems do not call
    # #to_s implicitly.
    severity: offense.severity.to_s,
    location: {
      begin_pos: offense.location.begin_pos,
      end_pos: offense.location.end_pos
    },
    message:  message(offense),
    cop_name: offense.cop_name,
    status:   status || offense.status
  }
end