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

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

  • Very high overall complexity (complexity = 752)

    Found in Raven::OkJson
  • Very high overall complexity (complexity = 390)

    Found in Raven::Event
  • Very complex method #ucharcopy (complexity = 128)

      def ucharcopy(t, s, i)
        n = s.length - i
        raise Utf8Error if n < 1
    
        c0 = s[i].ord
    
    View more
    Found in Raven::OkJson
  • Very complex method #unquote (complexity = 102)

      def unquote(q)
        q = q[1...-1]
        a = q.dup # allocate a big enough string
        # In ruby >= 1.9, a[w] is a codepoint, not a byte.
        if rubydoesenc?
    
    View more
    Found in Raven::OkJson
  • Very high overall complexity (complexity = 267)

    Found in Raven
  • Very complex method #ucharenc (complexity = 88)

      def ucharenc(a, i, u)
        if u <= Uchar1max
          a[i] = (u & 0xff).chr
          1
        elsif u <= Uchar2max
    
    View more
    Found in Raven::OkJson
  • 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
  • Complex method #strenc (complexity = 59)

      def strenc(s)
        t = StringIO.new
        t.putc(?")
        r = 0
    
    
    View more
    Found in Raven::OkJson
  • Complex method #initialize (complexity = 58)

        def initialize(init = {})
          @configuration = Raven.configuration
          @interfaces    = {}
          @context       = Raven.context
          @id            = generate_event_id
    
    View more
    Found in Raven::Event
  • 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 method .test (complexity = 51)

        def self.test(dsn = nil)
          require 'logger'
    
          logger = ::Logger.new(STDOUT)
          logger.level = ::Logger::ERROR
    
    View more
    Found in Raven::CLI
  • Complex code in Raven::Configuration definition outside of methods (complexity = 48)

  • Complex method #from_exception (complexity = 47)

          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 code in Raven::Rails definition outside of methods (complexity = 45)

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

          def set_conn
            verify_configuration
    
            Raven.logger.debug "Raven HTTP Transport connecting to #{configuration.server}"
    
    
    View more
  • Complex code in Delayed::Plugins::Raven definition outside of methods (complexity = 40)

  • Complex method #tok (complexity = 34)

      def tok(s)
        case s[0]
        when ?{ then ['{', s[0,1], s[0,1]]
        when ?} then ['}', s[0,1], s[0,1]]
        when ?: then [':', s[0,1], s[0,1]]
    
    View more
    Found in Raven::OkJson
  • Complex code in Raven definition outside of methods (complexity = 34)

    Found in Raven
  • 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 #capture_type (complexity = 31)

        def capture_type(obj, options = {})
          return false unless should_capture?(obj)
          message_or_exc = obj.is_a?(String) ? "message" : "exception"
          if (evt = Event.send("from_" + message_or_exc, obj, options))
            yield evt if block_given?
    
    View more
    Found in Raven
  • Complex method #hexdec4 (complexity = 30)

      def hexdec4(s)
        if s.length != 4
          raise Error, 'short'
        end
        (nibble(s[0])<<12) | (nibble(s[1])<<8) | (nibble(s[2])<<4) | nibble(s[3])
    
    View more
    Found in Raven::OkJson
  • Complex method #to_hash (complexity = 30)

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

      def objparse(ts)
        ts = eat('{', ts)
        obj = {}
    
        unless ts[0]
    
    View more
    Found in Raven::OkJson
  • Complex method #arrparse (complexity = 29)

      def arrparse(ts)
        ts = eat('[', ts)
        arr = []
    
        unless ts[0]
    
    View more
    Found in Raven::OkJson
  • Complex method #initialize (complexity = 28)

        def initialize
          self.server = ENV['SENTRY_DSN'] if ENV['SENTRY_DSN']
          @context_lines = 3
          self.current_environment = ENV['RAILS_ENV'] || ENV['RACK_ENV'] || 'default'
          self.send_modules = true
    
    View more
  • Complex method #nibble (complexity = 28)

      def nibble(c)
        if ?0 <= c && c <= ?9 then c.ord - ?0.ord
        elsif ?a <= c && c <= ?z then c.ord - ?a.ord + 10
        elsif ?A <= c && c <= ?Z then c.ord - ?A.ord + 10
        else
    
    View more
    Found in Raven::OkJson
  • Complex method #failed_send (complexity = 28)

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

        def rails_safely_prepend(module_name, opts = {})
          return if opts[:to].nil?
          if opts[:to].respond_to?(:prepend, true)
            opts[:to].send(:prepend, Raven::Rails::Overrides.const_get(module_name))
          else
    
    View more
    Found in Raven
  • Previous Page
    Next Page