getsentry/raven-ruby

View on GitHub
sentry-raven/lib/raven/configuration.rb

Summary

Maintainability
C
1 day
Test Coverage

Class Configuration has 34 methods (exceeds 20 allowed). Consider refactoring.
Open

  class Configuration
    # Directories to be recognized as part of your app. e.g. if you
    # have an `engines` dir at the root of your project, you may want
    # to set this to something like /(app|config|engines|lib)/
    attr_accessor :app_dirs_pattern
Severity: Minor
Found in sentry-raven/lib/raven/configuration.rb - About 4 hrs to fix

    File configuration.rb has 338 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require 'uri'
    
    module Raven
      class Configuration
        # Directories to be recognized as part of your app. e.g. if you
    Severity: Minor
    Found in sentry-raven/lib/raven/configuration.rb - About 4 hrs to fix

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

          def initialize
            self.async = false
            self.breadcrumbs_logger = []
            self.context_lines = 3
            self.current_environment = current_environment_from_env
      Severity: Minor
      Found in sentry-raven/lib/raven/configuration.rb - About 1 hr to fix

        Method server= has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def server=(value)
              return if value.nil?
        
              @dsn = value
        
        
        Severity: Minor
        Found in sentry-raven/lib/raven/configuration.rb - About 55 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 valid? has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def valid?
              return true if %w(server host path public_key project_id).all? { |k| public_send(k) }
        
              if server
                %w(server host path public_key project_id).map do |key|
        Severity: Minor
        Found in sentry-raven/lib/raven/configuration.rb - About 35 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 detect_release_from_heroku has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def detect_release_from_heroku
              return unless running_on_heroku?
              return if ENV['CI']
              logger.warn(HEROKU_DYNO_METADATA_MESSAGE) && return unless ENV['HEROKU_SLUG_COMMIT']
        
        
        Severity: Minor
        Found in sentry-raven/lib/raven/configuration.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 breadcrumbs_logger= has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

            def breadcrumbs_logger=(logger)
              loggers =
                if logger.is_a?(Array)
                  logger
                else
        Severity: Minor
        Found in sentry-raven/lib/raven/configuration.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

        There are no issues that match your filters.

        Category
        Status