railstaichung/rails-taichung

View on GitHub

Showing 177 of 177 total issues

Function injectElementWithStyles has 30 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    injectElementWithStyles = function( rule, callback, nodes, testnames ) {

      var style, ret, node, docOverflow,
          div = document.createElement('div'),
                body = document.body,
Severity: Minor
Found in app/assets/javascripts/Jcrop.js - About 1 hr to fix

    Function animate has 29 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        animate: function(x,y,w,h,cb){
          var t = this;
    
          t.selection.allowResize(false);
    
    
    Severity: Minor
    Found in app/assets/javascripts/Jcrop.js - About 1 hr to fix

      Function filter has 29 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          filter: function(b,ord,sel){
      
            if (!this.ratio) return b;
      
            var rt = b.w / b.h;
      Severity: Minor
      Found in app/assets/javascripts/Jcrop.js - About 1 hr to fix

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

          this.Gmaps.Base = (function() {
            function Base() {}
        
            Base.extend = function(obj) {
              var key, value, _ref;
        Severity: Minor
        Found in public/javascripts/gmaps_google.js - About 1 hr to fix

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

                if (b.x2 > r.maxx) { b.x2 = r.maxx; b.x = b.x2 - b.w; }
          Severity: Major
          Found in app/assets/javascripts/Jcrop.js and 3 other locations - About 1 hr to fix
          app/assets/javascripts/Jcrop.js on lines 328..328
          app/assets/javascripts/Jcrop.js on lines 329..329
          app/assets/javascripts/Jcrop.js on lines 331..331

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

                if (b.x < r.minx) { b.x = r.minx; b.x2 = b.w + b.x; }
          Severity: Major
          Found in app/assets/javascripts/Jcrop.js and 3 other locations - About 1 hr to fix
          app/assets/javascripts/Jcrop.js on lines 329..329
          app/assets/javascripts/Jcrop.js on lines 330..330
          app/assets/javascripts/Jcrop.js on lines 331..331

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

                if (b.y2 > r.maxy) { b.y2 = r.maxy; b.y = b.y2 - b.h; }
          Severity: Major
          Found in app/assets/javascripts/Jcrop.js and 3 other locations - About 1 hr to fix
          app/assets/javascripts/Jcrop.js on lines 328..328
          app/assets/javascripts/Jcrop.js on lines 329..329
          app/assets/javascripts/Jcrop.js on lines 330..330

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

                if (b.y < r.miny) { b.y = r.miny; b.y2 = b.h + b.y; }
          Severity: Major
          Found in app/assets/javascripts/Jcrop.js and 3 other locations - About 1 hr to fix
          app/assets/javascripts/Jcrop.js on lines 328..328
          app/assets/javascripts/Jcrop.js on lines 330..330
          app/assets/javascripts/Jcrop.js on lines 331..331

          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

              Handler.prototype.removeMarkers = function(gem_markers) {
                var _this = this;
                return _.map(gem_markers, function(gem_marker) {
                  return _this.removeMarker(gem_marker);
                });
          Severity: Major
          Found in public/javascripts/gmaps_google.js and 1 other location - About 1 hr to fix
          public/javascripts/gmaps_google.js on lines 757..762

          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

              Clusterer.prototype.addMarkers = function(markers) {
                var _this = this;
                return _.each(markers, function(marker) {
                  return _this.addMarker(marker);
                });
          Severity: Major
          Found in public/javascripts/gmaps_google.js and 1 other location - About 1 hr to fix
          public/javascripts/gmaps_google.js on lines 193..198

          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

                    [this.element.find('input'), {
                      focus:   $.proxy(this.show, this),
                      keyup:   $.proxy(this.update, this),
                      keydown: $.proxy(this.keydown, this)
                    }],
          Severity: Major
          Found in app/assets/javascripts/bootstrap-datetimepicker.js and 1 other location - About 1 hr to fix
          app/assets/javascripts/bootstrap-datetimepicker.js on lines 284..288

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

          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

                    [this.element, {
                      focus:   $.proxy(this.show, this),
                      keyup:   $.proxy(this.update, this),
                      keydown: $.proxy(this.keydown, this)
                    }]
          Severity: Major
          Found in app/assets/javascripts/bootstrap-datetimepicker.js and 1 other location - About 1 hr to fix
          app/assets/javascripts/bootstrap-datetimepicker.js on lines 294..298

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

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

              filter: function(b,ord,sel){
          
                if (!sel.active) return b;
          
                var t = this,
          Severity: Minor
          Found in app/assets/javascripts/Jcrop.js - About 1 hr to fix

            Function isEventSupported has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                isEventSupported = (function() {
            
                  var TAGNAMES = {
                    'select': 'input', 'change': 'input',
                    'submit': 'form', 'reset': 'form',
            Severity: Minor
            Found in app/assets/javascripts/Jcrop.js - About 1 hr to fix

              Function bind has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    Function.prototype.bind = function bind(that) {
              
                      var target = this;
              
                      if (typeof target != "function") {
              Severity: Minor
              Found in app/assets/javascripts/Jcrop.js - About 1 hr to fix

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

                        if (xx < 0) {
                          x1 -= xx;
                          xx = 0;
                        } else if (xx > boundx) {
                          x1 -= xx - boundx;
                Severity: Major
                Found in app/assets/javascripts/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.Jcrop.js on lines 613..619

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

                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 (yy < 0) {
                          y1 -= yy;
                          yy = 0;
                        } else if (yy > boundy) {
                          y1 -= yy - boundy;
                Severity: Major
                Found in app/assets/javascripts/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.Jcrop.js on lines 605..611

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

                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 ((nw > w) && w > 0) {
                        nw = w;
                        nh = (w / $obj.width()) * $obj.height();
                      }
                Severity: Major
                Found in app/assets/javascripts/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.Jcrop.js on lines 195..198

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

                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 ((nh > h) && h > 0) {
                        nh = h;
                        nw = (h / $obj.height()) * $obj.width();
                      }
                Severity: Major
                Found in app/assets/javascripts/jquery.Jcrop.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/jquery.Jcrop.js on lines 191..194

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

                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

                        return UTCDate(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate(), date.getUTCHours(), date.getUTCMinutes(), date.getUTCSeconds(), 0);
                Severity: Major
                Found in app/assets/javascripts/bootstrap-datetimepicker.js and 1 other location - About 1 hr to fix
                app/assets/javascripts/bootstrap-datetimepicker.js on lines 72..72

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

                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