Welcome to mirror list, hosted at ThFree Co, Russian Federation.

codequality_degradation_entity.rb « serializers « app - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: b9049bc90b9cfd0a881c2ea7b9a49460f7569636 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# frozen_string_literal: true

class CodequalityDegradationEntity < Grape::Entity
  expose :description
  expose :fingerprint
  expose :severity do |degradation|
    degradation.dig(:severity)&.downcase
  end

  expose :file_path do |degradation|
    degradation.dig(:location, :path)
  end

  expose :line do |degradation|
    degradation.dig(:location, :lines, :begin) || degradation.dig(:location, :positions, :begin, :line)
  end

  expose :web_url

  expose :engine_name
end