gerencianet/gn-api-sdk-ruby

View on GitHub

Showing 5 of 70 total issues

File constants.rb has 272 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Gerencianet
  # Endpoints signatures
  module Constants
    URL = {
      DEFAULT: {
Severity: Minor
Found in lib/gerencianet/constants.rb - About 2 hrs to fix

    Method authenticate has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def authenticate
          if (@options.has_key?(:pix_cert))
            url = get_url({}, @endpoints[:PIX][:authorize][:route])
          else
            url = get_url({}, @endpoints[:DEFAULT][:authorize][:route])
    Severity: Minor
    Found in lib/gerencianet/endpoints.rb - About 1 hr to fix

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

          def make_request(params, body, settings)
            url = get_url(params, settings[:route])
            headers = {
              "accept" => "application/json",
              "api-sdk" => "ruby-#{Gerencianet::VERSION}"
      Severity: Minor
      Found in lib/gerencianet/endpoints.rb - About 1 hr to fix

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

            def current_base_url
              if (@options.has_key?(:pix_cert))
                @options[:sandbox] ? @urls[:PIX][:sandbox] : @urls[:PIX][:production]
              else
                @options[:sandbox] ? @urls[:DEFAULT][:sandbox] : @urls[:DEFAULT][:production]
        Severity: Minor
        Found in lib/gerencianet/endpoints.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 authenticate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def authenticate
              if (@options.has_key?(:pix_cert))
                url = get_url({}, @endpoints[:PIX][:authorize][:route])
              else
                url = get_url({}, @endpoints[:DEFAULT][:authorize][:route])
        Severity: Minor
        Found in lib/gerencianet/endpoints.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