hummingbird-me/hummingbird

View on GitHub

Showing 859 of 859 total issues

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

                delayedTriggers.push((function(c) { return function(event) { c._trigger("deactivate", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
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 5177..5177

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

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

                delayedTriggers.push((function(c) { return function(event) { c._trigger("out", event, this._uiHash(this)); };  }).call(this, this.containers[i]));
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 5174..5174

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

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

  displayChapterCount: (function() {
    var e;
    e = void 0;
    e = this.get("chapterCount");
    if (e) {
Severity: Major
Found in frontend/app/models/manga.js and 1 other location - About 1 hr to fix
frontend/app/models/manga.js on lines 45..54

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

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 name has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    $.fn[ name ] = function( options ) {
        var isMethodCall = typeof options === "string",
            args = slice.call( arguments, 1 ),
            returnValue = this;

Severity: Minor
Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

    Function getPath has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        , getPath: function ( elem ) {
    
          if ( 'undefined' === typeof elem ) {
            elem = this.$element;
          }
    Severity: Minor
    Found in app/assets/javascripts/old/garlic.js - About 1 hr to fix

      Function load has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          load: function( index, event ) {
              index = this._getIndex( index );
              var that = this,
                  tab = this.tabs.eq( index ),
                  anchor = tab.find( ".ui-tabs-anchor" ),
      Severity: Minor
      Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

        Method similar has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def similar(limit = 20, options = {})
            # FIXME
            return [] if Rails.env.development?
        
            exclude = options[:exclude] ? options[:exclude] : []
        Severity: Minor
        Found in app/models/anime.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 upcoming has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def upcoming
            hide_cover_image
        
            season_months = {
              'winter' => [12, 1, 2],
        Severity: Minor
        Found in app/controllers/anime_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 index has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def index
            respond_to do |format|
              format.json do
                manga = Manga
                manga = Manga.where(slug: params[:ids]) if params[:ids]
        Severity: Minor
        Found in app/controllers/manga_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 index has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
        Open

          def index
            respond_to do |format|
              format.html do
                hide_cover_image
                @filter_years = %w(Upcoming 2010s 2000s 1990s 1980s 1970s Older)
        Severity: Minor
        Found in app/controllers/anime_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

        Function parse has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                JSON.parse = function (text, reviver) {
        
        // The parse method takes a text and an optional reviver function, and returns
        // a JavaScript value if the text is a valid JSON text.
        
        
        Severity: Minor
        Found in app/assets/javascripts/old/json2.js - About 1 hr to fix

          Function drag has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              drag: function( event ) {
          
                  var i = $(this).data("ui-draggable"), o = i.options, scrolled = false;
          
                  if(i.scrollParent[0] !== document && i.scrollParent[0].tagName !== "HTML") {
          Severity: Minor
          Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

            Function _resetButton has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                _resetButton: function() {
                    if ( this.type === "input" ) {
                        if ( this.options.label ) {
                            this.element.val( this.options.label );
                        }
            Severity: Minor
            Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

              Function _createTitlebar has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  _createTitlebar: function() {
                      var uiDialogTitle;
              
                      this.uiDialogTitlebar = $("<div>")
                          .addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix")
              Severity: Minor
              Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                Function _toggle has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    _toggle: function( data ) {
                        var toShow = data.newPanel,
                            toHide = this.prevShow.length ? this.prevShow : data.oldPanel;
                
                        // handle activating a panel during the animation for another activation
                Severity: Minor
                Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                  Function _mouseCapture has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      _mouseCapture: function(event, overrideHandle) {
                          var currentItem = null,
                              validHandle = false,
                              that = this;
                  
                  
                  Severity: Minor
                  Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                    Function _hideDatepicker has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        _hideDatepicker: function(input) {
                            var showAnim, duration, postProcess, onClose,
                                inst = this._curInst;
                    
                            if (!inst || (input && inst !== $.data(input, PROP_NAME))) {
                    Severity: Minor
                    Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                      Function _dialogDatepicker has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          _dialogDatepicker: function(input, date, onSelect, settings, pos) {
                              var id, browserWidth, browserHeight, scrollX, scrollY,
                                  inst = this._dialogInst; // internal instance
                      
                              if (!inst) {
                      Severity: Minor
                      Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

                        Function cancel has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            cancel: function() {
                        
                                if(this.dragging) {
                        
                                    this._mouseUp({ target: null });
                        Severity: Minor
                        Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

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

                                  se: function(event, dx, dy) {
                                      return $.extend(this._change.s.apply(this, arguments), this._change.e.apply(this, [event, dx, dy]));
                                  },
                          Severity: Major
                          Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js and 3 other locations - About 1 hr to fix
                          app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 3368..3370
                          app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 3371..3373
                          app/assets/javascripts/old/jquery-ui-custom-1.10.3.js on lines 3374..3376

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

                          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

                          Severity
                          Category
                          Status
                          Source
                          Language