debian-mirror-gitlab/app/serializers/codequality_degradation_entity.rb

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

21 lines
458 B
Ruby
Raw Normal View History

2021-02-22 17:27:13 +05:30
# frozen_string_literal: true
class CodequalityDegradationEntity < Grape::Entity
expose :description
2022-04-04 11:22:00 +05:30
expose :severity do |degradation|
degradation.dig(:severity)&.downcase
end
2021-02-22 17:27:13 +05:30
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
2023-01-13 00:05:48 +05:30
expose :web_url
2023-04-23 21:23:45 +05:30
expose :engine_name
2021-02-22 17:27:13 +05:30
end