internetee/registry

View on GitHub

Showing 94 of 104 total issues

Method index has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def index
      ca_cache = params[:q][:created_at_lteq]
      begin
        end_time = params[:q][:created_at_lteq].try(:to_date)
        params[:q][:created_at_lteq] = end_time.try(:end_of_day)
Severity: Minor
Found in app/controllers/admin/account_activities_controller.rb - About 25 mins to fix

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 generate_json has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def generate_json
    h = HashWithIndifferentAccess.new
    return h if domain.blank?

    if domain.discarded?
Severity: Minor
Found in app/models/whois_record.rb - About 25 mins to fix

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 6 (exceeds 5 allowed). Consider refactoring.
Open

  def perform
    uri = URI.parse(ENV['registry_demo_accredited_users_url'])
    response = base_get_request(uri: uri, port: ENV['registry_demo_registrar_port'])

    if response.code == '200'
Severity: Minor
Found in app/jobs/sync_accredited_users_job.rb - About 25 mins to fix

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 registrant_delete_confirmable? has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def registrant_delete_confirmable?(token)
    return false unless pending_delete?
    return false unless registrant_verification_asked?
    return false unless registrant_verification_token == token

Severity: Minor
Found in app/models/domain.rb - About 25 mins to fix

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 6 (exceeds 5 allowed). Consider refactoring.
Open

  def perform(email:, check_level: 'mx')
    contact = Contact.find_by(email: email)

    return logger.info "Contact #{email} not found!" if contact.nil?

Severity: Minor
Found in app/jobs/verify_emails_job.rb - About 25 mins to fix

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 validate_domain_integrity has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def validate_domain_integrity
      return unless Domain.release_to_auction

      dn = DNS::DomainName.new(domain.name)
      if dn.at_auction? || dn.is_deadline_is_reached?
Severity: Minor
Found in app/interactions/actions/domain_create.rb - About 25 mins to fix

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 element_count has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def element_count(*selectors)
      options = selectors.extract_options!
      use_prefix = options[:use_prefix] != false # use_prefix is true by default

      present_count = 0
Severity: Minor
Found in app/controllers/epp/base_controller.rb - About 25 mins to fix

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 serialize_distribution_result has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def serialize_distribution_result(result)
        result.map do |key, value|
          next unless registrar_names.key?(key)

          name = registrar_names[key]
Severity: Minor
Found in app/controllers/repp/v1/stats_controller.rb - About 25 mins to fix

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 cancel has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def cancel
    invoices.each do |invoice|
      next unless cancellable?(invoice)

      invoice.cancel
Severity: Minor
Found in app/services/overdue_invoice_canceller.rb - About 25 mins to fix

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 generate_ds_key_tag has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def generate_ds_key_tag
    return unless flags == 257 || flags == 256 # require ZoneFlag, but optional SecureEntryPoint
    pk = public_key.gsub(' ', '')
    wire_format = [flags, protocol, alg].pack('S!>CC')
    wire_format += Base64.decode64(pk)
Severity: Minor
Found in app/models/dnskey.rb - About 25 mins to fix

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 process_transactions has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def process_transactions(incoming_transaction, bank_statement)
      logger.info 'Got incoming transactions'
      logger.info incoming_transaction

      ActiveRecord::Base.transaction do
Severity: Minor
Found in app/controllers/eis_billing/lhv_connect_transactions_controller.rb - About 25 mins to fix

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 group_and_bulk_update has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def group_and_bulk_update(contacts)
    contacts.group_by(&:registrar_id).each do |registrar_id, reg_contacts|
      bulk_action, action = actions.create!(operation: :bulk_update) if reg_contacts.size > 1
      reg_contacts.each do |c|
        if c.save(validate: false)
Severity: Minor
Found in app/models/registrant_user.rb - About 25 mins to fix

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 find_or_init_monthly_invoice has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def find_or_init_monthly_invoice(month:, overwrite:)
    invoice = invoices.find_by(monthly_invoice: true, issue_date: month.end_of_month.to_date,
                               cancelled_at: nil)
    return invoice if invoice && !overwrite

Severity: Minor
Found in app/models/concerns/registrar/book_keeping.rb - About 25 mins to fix

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 calculate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def calculate
      if registrar.vat_liable_locally?(registry)
        current_year > 2023 ? registry.vat_rate : OLD_VAT_RATE  
      else
        registrar.vat_rate || 0
Severity: Minor
Found in app/models/invoice/vat_rate_calculator.rb - About 25 mins to fix

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

Severity
Category
Status
Source
Language