diff --git a/app/controllers/epp_controller.rb b/app/controllers/epp_controller.rb index 1cf54559e..c27ce1e6b 100644 --- a/app/controllers/epp_controller.rb +++ b/app/controllers/epp_controller.rb @@ -236,6 +236,8 @@ class EppController < ApplicationController end # rubocop: enable Style/PredicateName + # rubocop: disable Metrics/PerceivedComplexity + # rubocop: disable Metrics/CyclomaticComplexity def write_to_epp_log # return nil if EPP_LOG_ENABLED request_command = params[:command] || params[:action] # error receives :command, other methods receive :action @@ -257,4 +259,6 @@ class EppController < ApplicationController ip: request.ip }) end + # rubocop: enable Metrics/PerceivedComplexity + # rubocop: enable Metrics/CyclomaticComplexity end diff --git a/app/controllers/registrant/domain_update_confirms_controller.rb b/app/controllers/registrant/domain_update_confirms_controller.rb index 7cdcd3f4b..9830b5331 100644 --- a/app/controllers/registrant/domain_update_confirms_controller.rb +++ b/app/controllers/registrant/domain_update_confirms_controller.rb @@ -8,6 +8,8 @@ class Registrant::DomainUpdateConfirmsController < RegistrantController @domain = nil unless @domain.registrant_update_confirmable?(params[:token]) end + # rubocop: disable Metrics/PerceivedComplexity + # rubocop: disable Metrics/CyclomaticComplexity def update @domain = Domain.find(params[:id]) unless @domain.registrant_update_confirmable?(params[:token]) @@ -37,4 +39,6 @@ class Registrant::DomainUpdateConfirmsController < RegistrantController end end end + # rubocop: enable Metrics/PerceivedComplexity + # rubocop: enable Metrics/CyclomaticComplexity end diff --git a/app/models/certificate.rb b/app/models/certificate.rb index c5b18ebe7..a6fdd9b6b 100644 --- a/app/models/certificate.rb +++ b/app/models/certificate.rb @@ -14,9 +14,8 @@ class Certificate < ActiveRecord::Base validate :validate_csr_and_crt def validate_csr_and_crt - if csr.blank? && crt.blank? - errors.add(:base, I18n.t(:crt_or_csr_must_be_present)) - end + return if csr.present? || crt.present? + errors.add(:base, I18n.t(:crt_or_csr_must_be_present)) end def parsed_crt diff --git a/app/models/domain.rb b/app/models/domain.rb index 621f7f6e0..3355469f1 100644 --- a/app/models/domain.rb +++ b/app/models/domain.rb @@ -297,7 +297,6 @@ class Domain < ActiveRecord::Base registrant.try(:name) end - # rubocop:disable Lint/Loop def generate_auth_info begin