markrebec/excursion

View on GitHub

Showing 6 of 6 total issues

Function Application has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  var Application = function(app) {
    for (prop in app) {
      this[prop] = app[prop];
    }

Severity: Minor
Found in app/assets/javascripts/excursion.js - About 1 hr to fix

    Function _decode has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function _decode( s ) {
        var pads = 0,
          i,
          b10,
          imax = s.length,
    Severity: Minor
    Found in app/assets/javascripts/excursion.js - About 1 hr to fix

      Function _encode has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        function _encode( s ) {
          if ( arguments.length !== 1 ) {
            throw "SyntaxError: exactly one argument required";
          }
      
      
      Severity: Minor
      Found in app/assets/javascripts/excursion.js - About 1 hr to fix

        Method register_application has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
        Open

            def self.register_application(app=nil, opts={}, &block)
              raise ArgumentError, "app must be an instance of Rails::Application" unless app.is_a?(Rails::Application) || block_given?
              opts = {store: true}.merge(opts)
              
              if app.is_a?(Rails::Application)
        Severity: Minor
        Found in lib/excursion/pool.rb - About 1 hr 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 all has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

              def all
                hash = @cache.all
                return hash unless hash.nil? || hash.empty?
                @model.all
              rescue Dalli::RingError => e
        Severity: Minor
        Found in lib/excursion/datastores/active_record_with_memcache.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 routes= has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

              def routes=(routes)
                return @routes = routes if routes.is_a?(ActionDispatch::Routing::RouteSet::NamedRouteCollection)
                raise ArgumentError, 'routes must be a Hash or NamedRouteCollection' unless routes.is_a?(Hash)
                @routes = ActionDispatch::Routing::RouteSet::NamedRouteCollection.new
                routes.each do |name, route|
        Severity: Minor
        Found in lib/excursion/pool/application.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

        Severity
        Category
        Status
        Source
        Language