gerencianet/gn-api-sdk-ruby

View on GitHub
lib/gerencianet/constants.rb

Summary

Maintainability
A
2 hrs
Test Coverage

Module has too many lines. [268/250]
Open

  module Constants
    URL = {
      DEFAULT: {
          production: "https://api.gerencianet.com.br/v1",
          sandbox: "https://sandbox.gerencianet.com.br/v1"
Severity: Minor
Found in lib/gerencianet/constants.rb by rubocop

This cop checks if the length a module exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.

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

    Freeze mutable objects assigned to constants.
    Open

        URL = {
          DEFAULT: {
              production: "https://api.gerencianet.com.br/v1",
              sandbox: "https://sandbox.gerencianet.com.br/v1"
          },
    Severity: Minor
    Found in lib/gerencianet/constants.rb by rubocop

    This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

    Example:

    # bad
    CONST = [1, 2, 3]
    
    # good
    CONST = [1, 2, 3].freeze

    Use 2 spaces for indentation in a hash, relative to the start of the line where the left curly brace is.
    Open

              production: "https://api.gerencianet.com.br/v1",
    Severity: Minor
    Found in lib/gerencianet/constants.rb by rubocop

    This cops checks the indentation of the first key in a hash literal where the opening brace and the first key are on separate lines. The other keys' indentations are handled by the AlignHash cop.

    By default, Hash literals that are arguments in a method call with parentheses, and where the opening curly brace of the hash is on the same line as the opening parenthesis of the method call, shall have their first key indented one step (two spaces) more than the position inside the opening parenthesis.

    Other hash literals shall have their first key indented one step more than the start of the line where the opening curly brace is.

    This default style is called 'specialinsideparentheses'. Alternative styles are 'consistent' and 'align_braces'. Here are examples:

    Example: EnforcedStyle: specialinsideparentheses (default)

    # The `special_inside_parentheses` style enforces that the first key
    # in a hash literal where the opening brace and the first key are on
    # separate lines is indented one step (two spaces) more than the
    # position inside the opening parentheses.
    
    # bad
    hash = {
      key: :value
    }
    and_in_a_method_call({
      no: :difference
                         })
    
    # good
    special_inside_parentheses
    hash = {
      key: :value
    }
    but_in_a_method_call({
                           its_like: :this
                         })

    Example: EnforcedStyle: consistent

    # The `consistent` style enforces that the first key in a hash
    # literal where the opening brace and the first key are on
    # seprate lines is indented the same as a hash literal which is not
    # defined inside a method call.
    
    # bad
    hash = {
      key: :value
    }
    but_in_a_method_call({
                           its_like: :this
                          })
    
    # good
    hash = {
      key: :value
    }
    and_in_a_method_call({
      no: :difference
    })

    Example: EnforcedStyle: align_braces

    # The `align_brackets` style enforces that the opening and closing
    # braces are indented to the same position.
    
    # bad
    and_now_for_something = {
                              completely: :different
    }
    
    # good
    and_now_for_something = {
                              completely: :different
                            }

    Use 2 spaces for indentation in a hash, relative to the start of the line where the left curly brace is.
    Open

              production: "https://api-pix.gerencianet.com.br",
    Severity: Minor
    Found in lib/gerencianet/constants.rb by rubocop

    This cops checks the indentation of the first key in a hash literal where the opening brace and the first key are on separate lines. The other keys' indentations are handled by the AlignHash cop.

    By default, Hash literals that are arguments in a method call with parentheses, and where the opening curly brace of the hash is on the same line as the opening parenthesis of the method call, shall have their first key indented one step (two spaces) more than the position inside the opening parenthesis.

    Other hash literals shall have their first key indented one step more than the start of the line where the opening curly brace is.

    This default style is called 'specialinsideparentheses'. Alternative styles are 'consistent' and 'align_braces'. Here are examples:

    Example: EnforcedStyle: specialinsideparentheses (default)

    # The `special_inside_parentheses` style enforces that the first key
    # in a hash literal where the opening brace and the first key are on
    # separate lines is indented one step (two spaces) more than the
    # position inside the opening parentheses.
    
    # bad
    hash = {
      key: :value
    }
    and_in_a_method_call({
      no: :difference
                         })
    
    # good
    special_inside_parentheses
    hash = {
      key: :value
    }
    but_in_a_method_call({
                           its_like: :this
                         })

    Example: EnforcedStyle: consistent

    # The `consistent` style enforces that the first key in a hash
    # literal where the opening brace and the first key are on
    # seprate lines is indented the same as a hash literal which is not
    # defined inside a method call.
    
    # bad
    hash = {
      key: :value
    }
    but_in_a_method_call({
                           its_like: :this
                          })
    
    # good
    hash = {
      key: :value
    }
    and_in_a_method_call({
      no: :difference
    })

    Example: EnforcedStyle: align_braces

    # The `align_brackets` style enforces that the opening and closing
    # braces are indented to the same position.
    
    # bad
    and_now_for_something = {
                              completely: :different
    }
    
    # good
    and_now_for_something = {
                              completely: :different
                            }

    Indent the right brace the same as the start of the line where the left brace is.
    Open

              },
    Severity: Minor
    Found in lib/gerencianet/constants.rb by rubocop

    This cops checks the indentation of the first key in a hash literal where the opening brace and the first key are on separate lines. The other keys' indentations are handled by the AlignHash cop.

    By default, Hash literals that are arguments in a method call with parentheses, and where the opening curly brace of the hash is on the same line as the opening parenthesis of the method call, shall have their first key indented one step (two spaces) more than the position inside the opening parenthesis.

    Other hash literals shall have their first key indented one step more than the start of the line where the opening curly brace is.

    This default style is called 'specialinsideparentheses'. Alternative styles are 'consistent' and 'align_braces'. Here are examples:

    Example: EnforcedStyle: specialinsideparentheses (default)

    # The `special_inside_parentheses` style enforces that the first key
    # in a hash literal where the opening brace and the first key are on
    # separate lines is indented one step (two spaces) more than the
    # position inside the opening parentheses.
    
    # bad
    hash = {
      key: :value
    }
    and_in_a_method_call({
      no: :difference
                         })
    
    # good
    special_inside_parentheses
    hash = {
      key: :value
    }
    but_in_a_method_call({
                           its_like: :this
                         })

    Example: EnforcedStyle: consistent

    # The `consistent` style enforces that the first key in a hash
    # literal where the opening brace and the first key are on
    # seprate lines is indented the same as a hash literal which is not
    # defined inside a method call.
    
    # bad
    hash = {
      key: :value
    }
    but_in_a_method_call({
                           its_like: :this
                          })
    
    # good
    hash = {
      key: :value
    }
    and_in_a_method_call({
      no: :difference
    })

    Example: EnforcedStyle: align_braces

    # The `align_brackets` style enforces that the opening and closing
    # braces are indented to the same position.
    
    # bad
    and_now_for_something = {
                              completely: :different
    }
    
    # good
    and_now_for_something = {
                              completely: :different
                            }

    Freeze mutable objects assigned to constants.
    Open

        ENDPOINTS = {
          DEFAULT: {
            authorize: {
              route: "/authorize",
              method: "post"
    Severity: Minor
    Found in lib/gerencianet/constants.rb by rubocop

    This cop checks whether some constant value isn't a mutable literal (e.g. array or hash).

    Example:

    # bad
    CONST = [1, 2, 3]
    
    # good
    CONST = [1, 2, 3].freeze

    There are no issues that match your filters.

    Category
    Status