100% free for Open Source, forever. Get another set of eyes on your code.

  • Very high overall complexity (complexity = 444)

    Found in Raven::Event
  • Very complex method #add_exception_interface (complexity = 79)

          def add_exception_interface(evt, exc)
            evt.interface(:exception) do |exc_int|
              exceptions = [exc]
              context = Set.new [exc.object_id]
              backtraces = Set.new
    
    View more
    Found in Raven::Event
  • High overall complexity (complexity = 218)

  • Very complex method #initialize (complexity = 71)

        def initialize(init = {})
          @configuration = init[:configuration] || Raven.configuration
          @interfaces    = {}
          @breadcrumbs   = init[:breadcrumbs] || Raven.breadcrumbs
          @context       = init[:context] || Raven.context
    
    View more
    Found in Raven::Event
  • Very complex method .test (complexity = 66)

        def self.test(dsn = nil, silent = false) # rubocop:disable all
          if silent
            Raven.configuration.logger = ::Logger.new(nil)
          else
            logger = ::Logger.new(STDOUT)
    
    View more
    Found in Raven::CLI
  • Complex code in Raven::Configuration definition outside of methods (complexity = 55)

  • Complex method #stacktrace_interface_from (complexity = 54)

          def stacktrace_interface_from(int, evt, backtrace)
            backtrace = Backtrace.parse(backtrace)
    
            int.frames = []
            backtrace.lines.reverse_each do |line|
    
    View more
    Found in Raven::Event
  • Complex code in Raven::Rails definition outside of methods (complexity = 50)

    Found in Raven::Rails
  • Complex method #set_conn (complexity = 43)

          def set_conn
            configuration.logger.debug "Raven HTTP Transport connecting to #{configuration.server}"
    
            ssl_configuration = configuration.ssl || {}
            ssl_configuration[:verify] = configuration.ssl_verification
    
    View more
  • Complex code in Delayed::Plugins::Raven definition outside of methods (complexity = 42)

  • Complex method #from_exception (complexity = 42)

          def from_exception(exc, options = {}, &block)
            exception_context = get_exception_context(exc) || {}
            options = Raven::Utils::DeepMergeHash.deep_merge(exception_context, options)
    
            configuration = options[:configuration] || Raven.configuration
    
    View more
    Found in Raven::Event
  • Complex method #capture_type (complexity = 40)

        def capture_type(obj, options = {})
          unless configuration.capture_allowed?(obj)
            logger.debug("#{obj} excluded from capture: #{configuration.error_messages}")
            return false
          end
    
    View more
  • Complex method #send_event (complexity = 39)

          def send_event(auth_header, data, options = {})
            unless configuration.sending_allowed?
              logger.debug("Event not sent: #{configuration.error_messages}")
            end
    
    
    View more
  • Complex method #safely_prepend (complexity = 35)

        def safely_prepend(module_name, opts = {})
          return if opts[:to].nil? || opts[:from].nil?
          if opts[:to].respond_to?(:prepend, true)
            opts[:to].send(:prepend, opts[:from].const_get(module_name))
          else
    
    View more
    Found in Raven
  • Similar code found in 1 other location (mass = 46)

        def fields_re
          @fields_re ||= /#{(DEFAULT_FIELDS | sanitize_http_headers).map do |f|
            use_boundary?(f) ? "\\b#{f}\\b" : f
          end.join("|")}/i
        end
    
    View more
  • Similar code found in 1 other location (mass = 46)

        def fields_re
          @fields_re ||= /#{(DEFAULT_FIELDS | sanitize_fields).map do |f|
            use_boundary?(f) ? "\\b#{f}\\b" : f
          end.join("|")}/i
        end
    
    View more
  • Complex method #add_breadcrumb (complexity = 35)

        def add_breadcrumb(severity, message = nil, progname = nil)
          message = progname if message.nil? # see Ruby's Logger docs for why
          return if ignored_logger?(progname)
          return if message.nil? || message == ""
    
    
    View more
  • Complex method #failed_send (complexity = 34)

        def failed_send(e, event)
          @state.failure
          if e # exception was raised
            configuration.logger.error "Unable to record event with remote Sentry server (#{e.class} - #{e.message})"
            e.backtrace[0..10].each { |line| configuration.logger.error(line) }
    
    View more
    Found in Raven::Client
  • Complex method #sanitize (complexity = 33)

        def sanitize(k, v)
          if v.is_a?(Hash)
            process(v)
          elsif v.is_a?(Array)
            v.map { |a| sanitize(k, a) }
    
    View more
  • Complex code in Raven::Event definition outside of methods (complexity = 33)

    Found in Raven::Event
  • Complex method #inject_only (complexity = 32)

        def inject_only(*only_integrations)
          only_integrations = only_integrations.map(&:to_s)
          integrations_to_load = Raven::AVAILABLE_INTEGRATIONS & only_integrations
          not_found_integrations = only_integrations - integrations_to_load
          if not_found_integrations.any?
    
    View more
    Found in Raven
  • Complex method #format_headers_for_sentry (complexity = 32)

        def format_headers_for_sentry(env_hash)
          env_hash.each_with_object({}) do |(key, value), memo|
            key = key.to_s # rack env can contain symbols
            value = value.to_s
            next unless key.upcase == key # Non-upper case stuff isn't either
    
    View more
  • Complex method #initialize (complexity = 31)

        def initialize
          self.async = false
          self.context_lines = 3
          self.current_environment = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'default'
          self.encoding = 'gzip'
    
    View more
  • Complex method #qualified_const_get (complexity = 30)

          def qualified_const_get(x)
            x = x.to_s
            parts = x.split("::")
            parts.reject!(&:empty?)
    
    
    View more
    Found in Raven::Event
  • Complex method #to_hash (complexity = 30)

          def to_hash(*args)
            data = super(*args)
            data[:filename] = filename
            data.delete(:vars) unless vars && !vars.empty?
            data.delete(:pre_context) unless pre_context && !pre_context.empty?
    
    View more
  • Complex method #server= (complexity = 30)

        def server=(value)
          uri = URI.parse(value)
          uri_path = uri.path.split('/')
    
          if uri.user
    
    View more
  • Complex method .included (complexity = 27)

          def self.included(base)
            base.class_eval do
              rescue_from(Exception) do |exception|
                # Do not capture exceptions when using Sidekiq so we don't capture
                # The same exception twice.
    
    View more
  • Previous Page
    Next Page