Skip to content
Snippets Groups Projects
Verified Commit e42a48d6 authored by Archish Thakkar's avatar Archish Thakkar :dart: Committed by GitLab
Browse files

Fix Lint/AmbiguousOperatorPrecedence 4 offenses

Changelog: other
EE: true
parent 961cbbb1
2 merge requests!162233Draft: Script to update Topology Service Gem,!151158Fix Lint/AmbiguousOperatorPrecedence 4 offenses
......@@ -12,15 +12,6 @@ Lint/AmbiguousOperatorPrecedence:
- 'config/initializers/1_settings.rb'
- 'config/initializers/carrierwave_s3_encryption_headers_patch.rb'
- 'config/initializers/kaminari_active_record_relation_methods_with_limit.rb'
- 'danger/roulette/Dangerfile'
- 'ee/app/models/geo/upload_registry.rb'
- 'ee/app/models/iterations/cadence.rb'
- 'ee/app/models/license.rb'
- 'ee/app/policies/ee/issuable_policy.rb'
- 'ee/app/services/boards/epics/position_create_service.rb'
- 'ee/app/services/geo/registry_consistency_service.rb'
- 'ee/app/services/vulnerabilities/create_service.rb'
- 'ee/lib/gitlab/expiring_subscription_message.rb'
- 'spec/lib/gitlab/conan_token_spec.rb'
- 'spec/lib/gitlab/database/background_migration/batched_job_spec.rb'
- 'spec/lib/gitlab/database/batch_count_spec.rb'
......
......@@ -62,7 +62,7 @@ def note_for_spin_role(spin, role, category)
spin.public_send(role)&.markdown_name(author: roulette.team_mr_author) # rubocop:disable GitlabSecurity/PublicSend
end
note || template % { role: role }
note || (template % { role: role })
end
def markdown_row_for_spin(category, spin)
......
......@@ -42,7 +42,7 @@ def self.with_status(status)
end
def file
upload&.path || s_('Removed upload with id %{id}') % { id: file_id }
upload&.path || (s_('Removed upload with id %{id}') % { id: file_id })
end
def project
......
......@@ -182,7 +182,7 @@ def next_open_iteration_start_date
if open_due_date < Date.current
intermediate_iterations = ((Date.current - open_start_date) / duration_in_days).floor
hypothetical_last_due_date = open_start_date + intermediate_iterations * duration_in_days - 1
hypothetical_last_due_date = open_start_date + (intermediate_iterations * duration_in_days) - 1
open_start_date = hypothetical_last_due_date.next_occurring(start_weekday)
end
......
......@@ -496,12 +496,12 @@ def prior_historical_max
# See comment for `prior_historical_max`.
def previous_started_at
(License.current&.starts_at || starts_at - 1.year).beginning_of_day
(License.current&.starts_at || (starts_at - 1.year)).beginning_of_day
end
# See comment for `prior_historical_max`.
def previous_expired_at
(License.current&.expires_at || expires_at && expires_at - 1.year || starts_at).end_of_day
(License.current&.expires_at || (expires_at && (expires_at - 1.year)) || starts_at).end_of_day
end
def restricted_user_count_with_threshold
......@@ -591,7 +591,7 @@ def not_expired
end
def starts_at_for_historical_data
(starts_at || Time.current - 1.year).beginning_of_day
(starts_at || (Time.current - 1.year)).beginning_of_day
end
def expires_at_for_historical_data
......
......@@ -22,7 +22,7 @@ module IssuablePolicy
enable :upload_issuable_metric_image
end
rule { is_author | can?(:create_issue) & can?(:update_issue) }.policy do
rule { is_author | (can?(:create_issue) & can?(:update_issue)) }.policy do
enable :update_issuable_metric_image
enable :destroy_issuable_metric_image
end
......
......@@ -15,7 +15,7 @@ def execute
Boards::EpicBoardPosition.new(
epic_id: list_epic.id,
epic_board_id: board_id,
relative_position: start_position + Boards::EpicBoardPosition::IDEAL_DISTANCE * index,
relative_position: start_position + (Boards::EpicBoardPosition::IDEAL_DISTANCE * index),
created_at: time,
updated_at: time
)
......
......@@ -63,7 +63,7 @@ def save_vulnerability(vulnerability, finding)
finding_id: finding.id
)
vulnerability.save && vulnerability.findings << finding
vulnerability.save && (vulnerability.findings << finding)
create_state_transition_if_needed(vulnerability, from_state) if @state
end
......
......@@ -117,7 +117,7 @@ def expiring_message
def namespace_expiring_message
message = []
message << _('Your %{strong}%{plan_name}%{strong_close} subscription for %{strong}%{namespace_name}%{strong_close} will expire on %{strong}%{expires_on}%{strong_close}.') % { expires_on: subscribable.expires_at.iso8601, plan_name: plan_name, strong: strong, strong_close: strong_close, namespace_name: namespace.name }
message << (_('Your %{strong}%{plan_name}%{strong_close} subscription for %{strong}%{namespace_name}%{strong_close} will expire on %{strong}%{expires_on}%{strong_close}.') % { expires_on: subscribable.expires_at.iso8601, plan_name: plan_name, strong: strong, strong_close: strong_close, namespace_name: namespace.name })
message << expiring_features_message
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment