reevoo/sapience-rb

View on GitHub
lib/sapience/log_methods.rb

Summary

Maintainability
A
1 hr
Test Coverage

Method log_with_level has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    def log_with_level(level, message = nil, payload = nil, exception = nil, &block)
Severity: Minor
Found in lib/sapience/log_methods.rb - About 35 mins to fix

    Method log_with_exception has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        def log_with_exception(level, message = nil, payload = nil, exception = nil, &block)
    Severity: Minor
    Found in lib/sapience/log_methods.rb - About 35 mins to fix

      Add an empty line after magic comments.
      Open

      module Sapience
      Severity: Minor
      Found in lib/sapience/log_methods.rb by rubocop

      Checks for a newline after the final magic comment.

      Example:

      # good
      # frozen_string_literal: true
      
      # Some documentation for Person
      class Person
        # Some code
      end
      
      # bad
      # frozen_string_literal: true
      # Some documentation for Person
      class Person
        # Some code
      end

      Convert if nested inside else to elsif.
      Open

              yield params if block
      Severity: Minor
      Found in lib/sapience/log_methods.rb by rubocop

      If the else branch of a conditional consists solely of an if node, it can be combined with the else to become an elsif. This helps to keep the nesting level from getting too deep.

      Example:

      # bad
      if condition_a
        action_a
      else
        if condition_b
          action_b
        else
          action_c
        end
      end
      
      # good
      if condition_a
        action_a
      elsif condition_b
        action_b
      else
        action_c
      end

      Line is too long. [84/80]
      Open

          def log_with_level(level, message = nil, payload = nil, exception = nil, &block)
      Severity: Minor
      Found in lib/sapience/log_methods.rb by rubocop

      Line is too long. [87/80]
      Open

            Sapience.capture_exception(payload, message: message) if payload.is_a?(Exception)
      Severity: Minor
      Found in lib/sapience/log_methods.rb by rubocop

      Line is too long. [88/80]
      Open

          def log_with_exception(level, message = nil, payload = nil, exception = nil, &block)
      Severity: Minor
      Found in lib/sapience/log_methods.rb by rubocop

      Missing top-level module documentation comment.
      Open

        module LogMethods
      Severity: Minor
      Found in lib/sapience/log_methods.rb by rubocop

      This cop checks for missing top-level documentation of classes and modules. Classes with no body are exempt from the check and so are namespace modules - modules that have nothing in their bodies except classes, other modules, or constant definitions.

      The documentation requirement is annulled if the class or module has a "#:nodoc:" comment next to it. Likewise, "#:nodoc: all" does the same for all its children.

      Example:

      # bad
      class Person
        # ...
      end
      
      # good
      # Description/Explanation of Person class
      class Person
        # ...
      end

      There are no issues that match your filters.

      Category
      Status