Commit 543723e8 authored by Kev's avatar Kev Committed by Douglas Barbosa Alexandre

Fix GraphQL/FieldMethod offense (Part 2/2)

parent 4ee3f688
......@@ -6,7 +6,3 @@ GraphQL/FieldMethod:
- app/graphql/types/metrics/dashboards/annotation_type.rb
- app/graphql/types/packages/package_details_type.rb
- app/graphql/types/project_type.rb
- ee/app/graphql/types/dast/profile_type.rb
- ee/app/graphql/types/dast_site_validation_type.rb
- ee/app/graphql/types/group_release_stats_type.rb
- ee/app/graphql/types/incident_management/oncall_rotation_type.rb
......@@ -26,7 +26,7 @@ module Types
description: 'Associated scanner profile.'
field :dast_profile_schedule, ::Types::Dast::ProfileScheduleType, null: true,
description: 'Associated profile schedule.'
description: 'Associated profile schedule.', method: :dast_profile_schedule
field :branch, Dast::ProfileBranchType, null: true,
description: 'Associated branch.',
......@@ -38,10 +38,6 @@ module Types
def edit_path
Gitlab::Routing.url_helpers.edit_project_on_demand_scan_path(object.project, object)
end
def dast_profile_schedule
object.dast_profile_schedule
end
end
end
end
......@@ -15,10 +15,7 @@ module Types
method: :state
field :normalized_target_url, GraphQL::Types::String, null: true,
description: 'Normalized URL of the target to be validated.'
def normalized_target_url
object.url_base
end
description: 'Normalized URL of the target to be validated.',
method: :url_base
end
end
......@@ -8,17 +8,10 @@ module Types
authorize :read_group_release_stats
field :releases_count, GraphQL::Types::Int, null: true,
description: 'Total number of releases in all descendant projects of the group.'
def releases_count
object.releases_count
end
description: 'Total number of releases in all descendant projects of the group.', method: :releases_count
field :releases_percentage, GraphQL::Types::Int, null: true,
description: "Percentage of the group's descendant projects that have at least one release."
def releases_percentage
object.releases_percentage
end
description: "Percentage of the group's descendant projects that have at least one release.",
method: :releases_percentage
end
end
......@@ -48,7 +48,8 @@ module Types
field :participants,
::Types::IncidentManagement::OncallParticipantType.connection_type,
null: true,
description: 'Participants of the on-call rotation.'
description: 'Participants of the on-call rotation.',
method: :active_participants
field :shifts,
::Types::IncidentManagement::OncallShiftType.connection_type,
......@@ -56,10 +57,6 @@ module Types
description: 'Blocks of time for which a participant is on-call within a given time frame. Time frame cannot exceed one month.',
max_page_size: MAX_SHIFTS_FOR_TIMEFRAME,
resolver: ::Resolvers::IncidentManagement::OncallShiftsResolver
def participants
object.active_participants
end
end
end
end
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment