henryaj/Maker-Spark-Server

View on GitHub

Showing 8 of 39 total issues

File bootstrap.js has 1517 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* ===================================================
 * bootstrap-transition.js v2.3.2
 * http://getbootstrap.com/2.3.2/javascript.html#transitions
 * ===================================================
 * Copyright 2013 Twitter, Inc.
Severity: Major
Found in app/public/js/bootstrap.js - About 4 days to fix

    Function slide has 45 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      , slide: function (type, next) {
          var $active = this.$element.find('.item.active')
            , $next = next || $active[type]()
            , isCycling = this.interval
            , direction = type == 'next' ? 'left' : 'right'
    Severity: Minor
    Found in app/public/js/bootstrap.js - About 1 hr to fix

      Function helper has 43 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      var helper = (function() {
      var BASE_API_PATH = 'plus/v1/';
      
        return {
          /**
      Severity: Minor
      Found in app/public/js/google_plus_api.js - About 1 hr to fix

        Function show has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          , show: function () {
              var $tip
                , pos
                , actualWidth
                , actualHeight
        Severity: Minor
        Found in app/public/js/bootstrap.js - About 1 hr to fix

          Function applyPlacement has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            , applyPlacement: function(offset, placement){
                var $tip = this.tip()
                  , width = $tip[0].offsetWidth
                  , height = $tip[0].offsetHeight
                  , actualWidth
          Severity: Minor
          Found in app/public/js/bootstrap.js - About 1 hr to fix

            Function keydown has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              , keydown: function (e) {
                  var $this
                    , $items
                    , $active
                    , $parent
            Severity: Minor
            Found in app/public/js/bootstrap.js - About 1 hr to fix

              Function helper has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
              Open

              var helper = (function() {
              var BASE_API_PATH = 'plus/v1/';
              
                return {
                  /**
              Severity: Minor
              Found in app/public/js/google_plus_api.js - 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 success_or_error_for has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                  def success_or_error_for(cause,user)
                      if cause == "sign_in"
                          if user
                              redirect '/'          
                          else
              Severity: Minor
              Found in app/helpers/user_helper.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