Showing 94 of 104 total issues
Class Domain
has 97 methods (exceeds 25 allowed). Consider refactoring. Open
class Domain < ApplicationRecord
include UserEvents
include Roids
include Versions # version/domain_version.rb
include Domain::Expirable
- Create a ticketCreate a ticket
File domain.rb
has 637 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Domain < ApplicationRecord
include UserEvents
include Roids
include Versions # version/domain_version.rb
include Domain::Expirable
- Create a ticketCreate a ticket
Class Contact
has 57 methods (exceeds 25 allowed). Consider refactoring. Open
class Contact < ApplicationRecord
include Versions # version/contact_version.rb
include Roids
include EppErrors
include UserEvents
- Create a ticketCreate a ticket
File contact.rb
has 453 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'deserializers/xml/legal_document'
class Contact < ApplicationRecord
include Versions # version/contact_version.rb
include Roids
- Create a ticketCreate a ticket
Method remove_duplicates
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
def self.remove_duplicates
start = Time.zone.now.to_f
Rails.logger.info '-----> Removing legal documents duplicates'
count = 0
modified = []
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Class BaseController
has 37 methods (exceeds 25 allowed). Consider refactoring. Open
class BaseController < ApplicationController
class AuthorizationError < StandardError; end
skip_before_action :verify_authenticity_token
check_authorization
layout false
- Create a ticketCreate a ticket
Method perform
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def perform(domain_name: nil)
if domain_name.nil?
domains = Domain.all.select { |domain| domain.created_at < Time.zone.now - NameserverValidator::VALIDATION_DOMAIN_PERIOD }
.select { |domain| domain.nameservers.exists? }
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File domain.rb
has 316 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'deserializers/xml/legal_document'
require 'deserializers/xml/nameserver'
require 'deserializers/xml/domain_create'
require 'deserializers/xml/domain_update'
class Epp::Domain < Domain
- Create a ticketCreate a ticket
Method upload_spreadsheet
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def upload_spreadsheet
if params[:q].nil?
flash[:alert] = 'No file upload! Look at the left of upload button!'
redirect_to admin_auctions_path and return
end
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File base_controller.rb
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Epp
class BaseController < ApplicationController
class AuthorizationError < StandardError; end
skip_before_action :verify_authenticity_token
check_authorization
- Create a ticketCreate a ticket
Class DomainUpdate
has 30 methods (exceeds 25 allowed). Consider refactoring. Open
class DomainUpdate # rubocop:disable Metrics/ClassLength
attr_reader :domain, :params, :bypass_verify
def initialize(domain, params, bypass_verify)
@domain = domain
- Create a ticketCreate a ticket
File registrar.rb
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Registrar < ApplicationRecord # rubocop:disable Metrics/ClassLength
include Versions # version/registrar_version.rb
include Registrar::BookKeeping
include EmailVerifable
include Registrar::LegalDoc
- Create a ticketCreate a ticket
Method login
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def login
success = true
@api_user = ApiUser.find_by(login_params)
webclient_request = ENV['webclient_ips'].split(',').map(&:strip).include?(request.ip)
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method perform
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def perform(domain_name: nil)
unless domain_name.nil?
domain = Domain.find_by(name: domain_name)
return logger.info "This domain not contain any dnskeys" if domain.dnskeys.empty?
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method login
has 73 lines of code (exceeds 40 allowed). Consider refactoring. Open
def login
success = true
@api_user = ApiUser.find_by(login_params)
webclient_request = ENV['webclient_ips'].split(',').map(&:strip).include?(request.ip)
- Create a ticketCreate a ticket
Method domains_by_registrar
has 73 lines of code (exceeds 40 allowed). Consider refactoring. Open
def domains_by_registrar(date_to)
sql = <<-SQL
SELECT
registrar_id,
SUM(domain_count) AS total_domain_count
- Create a ticketCreate a ticket
Method epp_code_map
has 70 lines of code (exceeds 40 allowed). Consider refactoring. Open
def epp_code_map
{
'2002' => [ # Command use error
%i[base domain_already_belongs_to_the_querying_registrar],
],
- Create a ticketCreate a ticket
File domains_controller.rb
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'deserializers/xml/domain_delete'
module Epp
class DomainsController < BaseController
before_action :find_domain, only: %i[info renew update transfer delete]
before_action :find_password, only: %i[info update transfer delete]
- Create a ticketCreate a ticket
Method cr_id
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def cr_id
# try this, rebuild user for registrar before searching history? really?
registrar = creator.try(:registrar)
if registrar.present? # Did creator return a kind of User that has a registrar?
registrar.code
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method dnskey_update_enabled
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def dnskey_update_enabled
find_domain
if @domain.dnskey_update_enabled? && !params[:parsed_frame].css('update').empty?
flag = true
- Read upRead up
- Create a ticketCreate a ticket
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"