hummingbird-me/hummingbird

View on GitHub

Showing 859 of 859 total issues

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

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

              }, function(err) {
                try {
                  self.set('errorMessage', err.jqXHR.responseJSON.error);
                } catch (e) {
                  self.set('errorMessage', 'An unknown error occurred');
        Severity: Major
        Found in frontend/app/controllers/sign-in.js and 1 other location - About 1 hr to fix
        frontend/app/controllers/sign-up.js on lines 91..97

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 57.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

              }, function(err) {
                try {
                  self.set('errorMessage', err.jqXHR.responseJSON.error);
                } catch (e) {
                  self.set('errorMessage', 'An unknown error occurred');
        Severity: Major
        Found in frontend/app/controllers/sign-up.js and 1 other location - About 1 hr to fix
        frontend/app/controllers/sign-in.js on lines 15..21

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 57.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    newRating = nearestHalf(5 * (e.pageX - $(widget).offset().left) / $(widget).width() + 0.5);
        Severity: Major
        Found in app/assets/javascripts/old/awesome_rating.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/old/awesome_rating.js on lines 99..99

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 57.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                } else if (/^(ne)$/.test(a)) {
                    that.size.width = newWidth;
                    that.size.height = newHeight;
                    that.position.top = op.top - oy;
                } else if (/^(sw)$/.test(a)) {
        Severity: Major
        Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 3707..3716

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 57.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                } else if (/^(sw)$/.test(a)) {
                    that.size.width = newWidth;
                    that.size.height = newHeight;
                    that.position.left = op.left - ox;
                } else {
        Severity: Major
        Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 3703..3716

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 57.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

                    newRating = nearestHalf(5 * (e.pageX - $(widget).offset().left) / $(widget).width() + 0.5);
        Severity: Major
        Found in app/assets/javascripts/old/awesome_rating.js and 1 other location - About 1 hr to fix
        app/assets/javascripts/old/awesome_rating.js on lines 112..112

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 57.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        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
                    Severity
                    Category
                    Status
                    Source
                    Language