verifalia/verifalia-ruby-sdk

View on GitHub

Showing 10 of 10 total issues

Method from_json has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

      def self.from_json(data)
        progress = nil

        # Parse the eventual progress information

Severity: Minor
Found in lib/verifalia/email_validation/job.rb - About 4 hrs 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 submit has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

      def submit(data,
                 quality: nil,
                 priority: nil,
                 deduplication: nil,
                 name: nil,
Severity: Minor
Found in lib/verifalia/email_validation/client.rb - About 3 hrs 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 submit has 71 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      def submit(data,
                 quality: nil,
                 priority: nil,
                 deduplication: nil,
                 name: nil,
Severity: Major
Found in lib/verifalia/email_validation/client.rb - About 2 hrs to fix

    Method initialize has 17 arguments (exceeds 4 allowed). Consider refactoring.
    Open

          def initialize (input_data, classification, status, email_address, email_address_local_part, email_address_domain_part,
                          has_international_mailbox_name, has_international_domain_name, is_disposable_email_address, is_role_account,
                          is_free_email_address, syntax_failure_index, custom, duplicate_of, completed_on, ascii_email_address_domain_part,
                          suggestions)
    Severity: Major
    Found in lib/verifalia/email_validation/entry.rb - About 2 hrs to fix

      Method invoke has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
      Open

            def invoke(method, resource, options = nil)
              errors = []
      
              # Performs a maximum of as many attempts as the number of configured base API endpoints, keeping track
              # of the last used endpoint after each call, in order to try to distribute the load evenly across the
      Severity: Minor
      Found in lib/verifalia/rest/client.rb - About 2 hrs 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 initialize has 14 arguments (exceeds 4 allowed). Consider refactoring.
      Open

            def initialize(id, submitted_on, completed_on, priority, name, owner, client_ip, created_on, quality, retention,
                           deduplication, status, no_of_entries, progress)
      Severity: Major
      Found in lib/verifalia/email_validation/overview.rb - About 1 hr to fix

        Method from_json has 43 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

              def self.from_json(data)
                progress = nil
        
                # Parse the eventual progress information
        
        
        Severity: Minor
        Found in lib/verifalia/email_validation/job.rb - About 1 hr to fix

          Method invoke has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                def invoke(method, resource, options = nil)
                  errors = []
          
                  # Performs a maximum of as many attempts as the number of configured base API endpoints, keeping track
                  # of the last used endpoint after each call, in order to try to distribute the load evenly across the
          Severity: Minor
          Found in lib/verifalia/rest/client.rb - About 1 hr to fix

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

                  def get(id, wait_options: nil)
                    wait_options_or_default = wait_options.nil? ? WaitOptions.default : wait_options
            
                    loop do
                      response = @rest_client.invoke 'get',
            Severity: Minor
            Found in lib/verifalia/email_validation/client.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 initialize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
            Open

                def initialize(authenticator: nil, username: nil, password: nil, ssl_client_cert: nil, ssl_client_key: nil, base_urls: nil, logger: nil)
                  @base_urls = base_urls
            
                  # Initialize the authenticator this client will use while connecting to the Verifalia API
            
            
            Severity: Minor
            Found in lib/verifalia/client.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