2021-12-09 12:15:43 +00:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
module Gitlab
|
|
|
|
module Abuse
|
|
|
|
CONFIDENCE_LEVELS = {
|
2022-08-18 15:12:17 +00:00
|
|
|
certain: 1.0,
|
|
|
|
likely: 0.8,
|
2021-12-09 12:15:43 +00:00
|
|
|
uncertain: 0.5,
|
2022-08-18 15:12:17 +00:00
|
|
|
unknown: 0.0
|
2021-12-09 12:15:43 +00:00
|
|
|
}.freeze
|
|
|
|
|
|
|
|
class << self
|
|
|
|
def confidence(rating)
|
|
|
|
CONFIDENCE_LEVELS.fetch(rating.to_sym)
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|