hummingbird-me/hummingbird

View on GitHub

Showing 419 of 859 total issues

Function _create has 28 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    _create: function() {
        this.originalCss = {
            display: this.element[0].style.display,
            width: this.element[0].style.width,
            minHeight: this.element[0].style.minHeight,
Severity: Minor
Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

    Function _initSource has 28 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        _initSource: function() {
            var array, url,
                that = this;
            if ( $.isArray(this.options.source) ) {
                array = this.options.source;
    Severity: Minor
    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

      Function values has 28 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          values: function( index, newValue ) {
              var vals,
                  newValues,
                  i;
      
      
      Severity: Minor
      Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

        Function save has 28 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            save: function() {
              // setup our params
              var root = this.get('model.constructor.modelName').pluralize().underscore(),
                  data = this.get('model').serialize(),
                  hash = {};
        Severity: Minor
        Found in frontend/app/mixins/modals/versionable.js - About 1 hr to fix

          Function usernameProblems has 28 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            usernameProblems: function () {
              var messages = [];
              var username = this.get('username');
              var blacklist = [ 'admin', 'administrator', 'connect', 'dashboard', 'developer', 'developers',
                'edit', 'favorites', 'feature', 'featured', 'features', 'feed', 'follow', 'followers',
          Severity: Minor
          Found in frontend/app/controllers/sign-up.js - About 1 hr to fix

            Function usernameProblems has 28 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              usernameProblems: function() {
                var messages = [];
                var username = this.get('currentUser.newUsername');
                var blacklist = [ 'admin', 'administrator', 'connect', 'dashboard', 'developer', 'developers',
                  'edit', 'favorites', 'feature', 'featured', 'features', 'feed', 'follow', 'followers',
            Severity: Minor
            Found in frontend/app/controllers/settings.js - About 1 hr to fix

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

                def rating_description(r)
                  return "Pathetic" if r == 1
                  return "Dreadful" if r == 2
                  return "Poor"     if r == 3
                  return "Mediocre" if r == 4
              Severity: Minor
              Found in app/helpers/reviews_helper.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 create has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                def create
                  authenticate_user!
              
                  @anime = Anime.find(params[:anime_id])
                  @review = Review.find_by_user_id_and_anime_id(current_user.id, @anime.id)
              Severity: Minor
              Found in app/controllers/reviews_controller.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 current_user has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                  def current_user
                    return env['current_user'] if env.has_key?('current_user')
              
                    if params[:auth_token] || cookies[:auth_token]
                      token = Token.new(params[:auth_token] || cookies[:auth_token])
              Severity: Minor
              Found in app/api/api_v1.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 from_action has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                def self.from_action(data)
                  user = User.find data[:user_id]
              
                  if data[:action_type] == "followed"
                    followed_user = User.find data[:followed_id]
              Severity: Minor
              Found in app/models/substory.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 broadcast has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
              Open

                def self.broadcast(data)
                  if data[:action_type] == "created_profile_comment"
                    # Create the story and substory for this action,
                    # TODO: generate notifications
                    # and return the story.
              Severity: Minor
              Found in app/services/action.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

              Function _checkUpdatedKeys has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function _checkUpdatedKeys(){
                      var oldCrc32List = JSON.parse(JSON.stringify(_storage.__jstorage_meta.CRC32)),
                          newCrc32List;
              
                      _reloadData();
              Severity: Minor
              Found in app/assets/javascripts/old/jstorage.js - About 1 hr to fix

                Function getDimensions has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function getDimensions( elem ) {
                    var raw = elem[0];
                    if ( raw.nodeType === 9 ) {
                        return {
                            width: elem.width(),
                Severity: Minor
                Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                  Function moveToPoint has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  Flipsnap.prototype.moveToPoint = function(point, transitionDuration) {
                    var self = this;
                  
                    transitionDuration = transitionDuration === undefined
                      ? self.transitionDuration : transitionDuration + 'ms';
                  Severity: Minor
                  Found in public/2014/assets/js/flipsnap.js - About 1 hr to fix

                    Function moveToPoint has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    Flipsnap.prototype.moveToPoint = function(point, transitionDuration) {
                      var self = this;
                    
                      transitionDuration = transitionDuration === undefined
                        ? self.transitionDuration : transitionDuration + 'ms';
                    Severity: Minor
                    Found in public/2013/assets/js/flipsnap.js - About 1 hr to fix

                      Function buildTree has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        function buildTree(tokens, kind, stack, customTags) {
                          var instructions = [],
                              opener = null,
                              token = null;
                      
                      
                      Severity: Minor
                      Found in app/assets/javascripts/old/hogan-2.0.0.js - About 1 hr to fix

                        Function left has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                left: function( position, data ) {
                                    var within = data.within,
                                        withinOffset = within.isWindow ? within.scrollLeft : within.offset.left,
                                        outerWidth = within.width,
                                        collisionPosLeft = position.left - data.collisionPosition.marginLeft,
                        Severity: Minor
                        Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                          Function top has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                                  top: function( position, data ) {
                                      var within = data.within,
                                          withinOffset = within.isWindow ? within.scrollTop : within.offset.top,
                                          outerHeight = data.within.height,
                                          collisionPosTop = position.top - data.collisionPosition.marginTop,
                          Severity: Minor
                          Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                            Function _updateVirtualBoundaries has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                _updateVirtualBoundaries: function(forceAspectRatio) {
                                    var pMinWidth, pMaxWidth, pMinHeight, pMaxHeight, b,
                                        o = this.options;
                            
                                    b = {
                            Severity: Minor
                            Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                              Function stop has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  stop: function( event ) {
                                      var that = $(this).data("ui-resizable"),
                                          o = that.options,
                                          pr = that._proportionallyResizeElements,
                                          ista = pr.length && (/textarea/i).test(pr[0].nodeName),
                              Severity: Minor
                              Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix
                                Severity
                                Category
                                Status
                                Source
                                Language