internetee/registry

View on GitHub
app/models/epp/domain.rb

Summary

Maintainability
C
1 day
Test Coverage
C
72%

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
Severity: Minor
Found in app/models/epp/domain.rb - About 3 hrs to fix

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],
      ],
Severity: Major
Found in app/models/epp/domain.rb - About 2 hrs to fix

Method transfer has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

  def transfer(frame, action, current_user)
    if discarded?
      add_epp_error('2106', nil, nil, 'Object is not eligible for transfer')
      return
    end
Severity: Minor
Found in app/models/epp/domain.rb - About 1 hr 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 check_availability has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

    def check_availability(domain_names)
      domain_names = [domain_names] if domain_names.is_a?(String)

      result = []

Severity: Minor
Found in app/models/epp/domain.rb - About 45 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

Avoid too many return statements within this method.
Open

      return reject_transfer(frame, current_user) if pending_transfer
Severity: Major
Found in app/models/epp/domain.rb - About 30 mins to fix

There are no issues that match your filters.

Category
Status