hummingbird-me/hummingbird

View on GitHub

Showing 859 of 859 total issues

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

    if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
      return Math.max.apply(Math, obj);
    }
Severity: Major
Found in app/assets/javascripts/old/underscore-1.4.4.js and 1 other location - About 1 hr to fix
app/assets/javascripts/old/underscore-1.4.4.js on lines 275..277

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 67.

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 3 locations. Consider refactoring.
Open

            lookAhead = function(match) {
                var matches = (iFormat + 1 < format.length && format.charAt(iFormat + 1) === match);
                if (matches) {
                    iFormat++;
                }
Severity: Major
Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 2 other locations - About 1 hr to fix
app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 8086..8092
app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 8168..8174

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 67.

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

                co.left + (parseInt($(ce).css("borderLeftWidth"),10) || 0) + (parseInt($(ce).css("paddingLeft"),10) || 0) - this.margins.left,
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 5006..5006

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 67.

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

    if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) {
      return Math.min.apply(Math, obj);
    }
Severity: Major
Found in app/assets/javascripts/old/underscore-1.4.4.js and 1 other location - About 1 hr to fix
app/assets/javascripts/old/underscore-1.4.4.js on lines 261..263

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 67.

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 br_to_p has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  def br_to_p(src)
    src = '<p>' + src.gsub(/<br>\s*<br>/, '</p><p>') + '</p>'
    doc = Nokogiri::HTML.fragment src
    doc.traverse do |x|
      next x.remove if x.name == 'br' && x.previous.nil?
Severity: Minor
Found in lib/mal_import.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 reposition has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    reposition : function (target, tip, classes) {
      var width, nub, nubHeight, nubWidth, column, objPos;

      tip.css('visibility', 'hidden').show();

Severity: Minor
Found in public/2014/assets/js/foundation/foundation.tooltip.js - About 1 hr to fix

    Function bridge has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    $.widget.bridge = function( name, object ) {
        var fullName = object.prototype.widgetFullName || name;
        $.fn[ name ] = function( options ) {
            var isMethodCall = typeof options === "string",
                args = slice.call( arguments, 1 ),
    Severity: Minor
    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

      Function init has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          init : function (scope, method, options) {
            Foundation.inherit(this, 'data_options');
            var self = this;
      
            if (typeof method === 'object') {
      Severity: Minor
      Found in app/assets/javascripts/old/application.js - About 1 hr to fix

        Function reposition has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            reposition : function (target, tip, classes) {
              var width, nub, nubHeight, nubWidth, column, objPos;
        
              tip.css('visibility', 'hidden').show();
        
        
        Severity: Minor
        Found in app/assets/javascripts/old/application.js - About 1 hr to fix

          Function reposition has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              reposition : function (target, tip, classes) {
                var width, nub, nubHeight, nubWidth, column, objPos;
          
                tip.css('visibility', 'hidden').show();
          
          
          Severity: Minor
          Found in public/2013/assets/js/foundation/foundation.tooltip.js - About 1 hr to fix

            Function _optionDatepicker has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _optionDatepicker: function(target, name, value) {
                    var settings, date, minDate, maxDate,
                        inst = this._getInst(target);
            
                    if (arguments.length === 2 && typeof name === "string") {
            Severity: Minor
            Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

              Method broadcast has 39 lines of code (exceeds 25 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

                Method search has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  def search
                    respond_to do |format|
                      format.json do
                        query = params.require(:query)
                
                
                Severity: Minor
                Found in app/controllers/search_controller.rb - About 1 hr to fix

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

                  FastClick.prototype.determineEventType = function(targetElement) {
                      'use strict';
                  
                      //Issue #159: Android Chrome Select Box does not open with a synthetic click event
                      if (this.deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
                  Severity: Major
                  Found in public/2013/assets/js/fastclick.js and 1 other location - About 1 hr to fix
                  public/2014/assets/js/fastclick.js on lines 294..303

                  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 66.

                  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

                  FastClick.prototype.determineEventType = function(targetElement) {
                      'use strict';
                  
                      //Issue #159: Android Chrome Select Box does not open with a synthetic click event
                      if (this.deviceIsAndroid && targetElement.tagName.toLowerCase() === 'select') {
                  Severity: Major
                  Found in public/2014/assets/js/fastclick.js and 1 other location - About 1 hr to fix
                  public/2013/assets/js/fastclick.js on lines 294..303

                  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 66.

                  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

                          top: function() {
                              $.ui.position.flip.top.apply( this, arguments );
                              $.ui.position.fit.top.apply( this, arguments );
                          }
                  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 1419..1422

                  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 66.

                  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

                          left: function() {
                              $.ui.position.flip.left.apply( this, arguments );
                              $.ui.position.fit.left.apply( this, arguments );
                          },
                  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 1423..1426

                  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 66.

                  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

                                  case 35: if (event.ctrlKey || event.metaKey) {
                                              $.datepicker._clearDate(event.target);
                                          }
                                          handled = event.ctrlKey || event.metaKey;
                                          break; // clear on ctrl or command +end
                  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 7387..7391

                  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 66.

                  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

                                  case 36: if (event.ctrlKey || event.metaKey) {
                                              $.datepicker._gotoToday(event.target);
                                          }
                                          handled = event.ctrlKey || event.metaKey;
                                          break; // current on ctrl or command +home
                  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 7382..7386

                  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 66.

                  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

                  Function _on has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _on: function( suppressDisabledCheck, element, handlers ) {
                          var delegateElement,
                              instance = this;
                  
                          // no suppressDisabledCheck flag, shuffle arguments
                  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