hummingbird-me/hummingbird

View on GitHub

Showing 859 of 859 total issues

Method recompute_bayesian_ratings! has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def recompute_bayesian_ratings!
      #
      # Bayesian rating:
      #
      #     r * v / (v + m) + c * m / (v + m)
Severity: Minor
Found in app/models/concerns/bayesian_averageable.rb - About 1 hr to fix

    Method from_library_entry has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      def self.from_library_entry(l)
        return unless l.valid?
    
        if l.persisted?
    
    
    Severity: Minor
    Found in app/services/action.rb - About 1 hr to fix

      Function onTouchStart has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      FastClick.prototype.onTouchStart = function(event) {
          'use strict';
          var targetElement, touch, selection;
      
          // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
      Severity: Minor
      Found in public/2014/assets/js/fastclick.js - 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 onTouchStart has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

      FastClick.prototype.onTouchStart = function(event) {
          'use strict';
          var targetElement, touch, selection;
      
          // Ignore multiple touches, otherwise pinch-to-zoom is prevented if both fingers are on the FastClick element (issue #111).
      Severity: Minor
      Found in public/2013/assets/js/fastclick.js - 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 clean_desc has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        def clean_desc(desc)
          desc = Nokogiri::HTML.fragment br_to_p(desc)
          desc.css('.spoiler').each do |x|
            x.name = 'span'
            x.inner_html = x.css('.spoiler_content').inner_html
      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

      Method data has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

        def data
          if @data.nil?
            @data = []
      
            # wrap+flatten+compact to ensure we get an array with no nils
      Severity: Minor
      Found in lib/my_anime_list_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

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

          showSection: function (section) {
            if (typeof section === "string") {
              return this.set('showSection', section);
            } else {
              return this.set('showSection', section.get('title'));
      Severity: Major
      Found in frontend/app/controllers/user/library.js and 1 other location - About 1 hr to fix
      frontend/app/controllers/user/manga-library.js on lines 126..132

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

      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

          showSection: function (section) {
            if (typeof section === "string") {
              return this.set('showSection', section);
            } else {
              return this.set('showSection', section.get('title'));
      Severity: Major
      Found in frontend/app/controllers/user/manga-library.js and 1 other location - About 1 hr to fix
      frontend/app/controllers/user/library.js on lines 128..134

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

      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("receive", event, this._uiHash(this)); };  }).call(this, this.currentContainer));
      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 5166..5166

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

      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("update", event, this._uiHash(this));  }; }).call(this, this.currentContainer));
      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 5165..5165

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

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

          events : function () {
            var self = this;
      
            if (Modernizr.touch) {
              $(this.scope)
      Severity: Minor
      Found in public/2013/assets/js/foundation/foundation.tooltip.js - About 1 hr to fix

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

          $.fn.charCount = function(options){
            
            // default configuration properties
            var defaults = {  
              allowed: 140,   
        Severity: Minor
        Found in app/assets/javascripts/old/charcount.js - About 1 hr to fix

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

          this.initializeRatingInterface = function(element, type) {
            var anime_slug, i, rating, star, _i;
            return;
            rating = parseInt(element.attr("data-rating"));
            anime_slug = element.attr("data-anime-slug");
          Severity: Minor
          Found in app/assets/javascripts/old/library_update.js - About 1 hr to fix

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

                events : function () {
                  var self = this;
            
                  if (Modernizr.touch) {
                    $(this.scope)
            Severity: Minor
            Found in public/2014/assets/js/foundation/foundation.tooltip.js - About 1 hr to fix

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

                  option: function( key, value ) {
                      var options = key,
                          parts,
                          curOption,
                          i;
              Severity: Minor
              Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.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/assets/javascripts/old/bootstrap-tooltip.js - About 1 hr to fix

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

                      function Duration(duration) {
                          var data = this._data = {},
                              years = duration.years || duration.year || duration.y || 0,
                              months = duration.months || duration.month || duration.M || 0,
                              weeks = duration.weeks || duration.week || duration.w || 0,
                  Severity: Minor
                  Found in app/assets/javascripts/old/moment.js - About 1 hr to fix

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

                      function operate(input, direct, method) {
                        var node = input[0];
                          state = /er/.test(method) ? _indeterminate : /bl/.test(method) ? _disabled : _checked,
                          active = method == _update ? {
                            checked: node[_checked],
                    Severity: Minor
                    Found in app/assets/javascripts/old/jquery.icheck.js - About 1 hr to fix

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

                                  offsetString = function(offset) {
                                      try {
                                          return $.datepicker.parseDate($.datepicker._get(inst, "dateFormat"),
                                              offset, $.datepicker._getFormatConfig(inst));
                                      }
                      Severity: Minor
                      Found in app/assets/javascripts/old/jquery-ui-custom-1.10.3.js - About 1 hr to fix

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

                            _destroy: function() {
                                var contents;
                        
                                // clean up main element
                                this.element
                        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