estimancy/projestimate

View on GitHub
app/assets/javascripts/jscolor.js

Summary

Maintainability
F
2 wks
Test Coverage

Function color has a Cognitive Complexity of 224 (exceeds 5 allowed). Consider refactoring.
Open

    color : function(target, prop) {


        this.required = true; // refuse empty values?
        this.adjust = true; // adjust value to uniform notation?
Severity: Minor
Found in app/assets/javascripts/jscolor.js - About 4 days 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 color has 565 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    color : function(target, prop) {


        this.required = true; // refuse empty values?
        this.adjust = true; // adjust value to uniform notation?
Severity: Major
Found in app/assets/javascripts/jscolor.js - About 2 days to fix

    File jscolor.js has 821 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /**
     * jscolor, JavaScript Color Picker
     *
     * @version 1.4.3
     * @license GNU Lesser General Public License, http://www.gnu.org/copyleft/lesser.html
    Severity: Major
    Found in app/assets/javascripts/jscolor.js - About 1 day to fix

      Function URI has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
      Open

          URI : function(uri) { // See RFC3986
      
              this.scheme = null;
              this.authority = null;
              this.path = '';
      Severity: Minor
      Found in app/assets/javascripts/jscolor.js - About 1 day 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 drawPicker has 193 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              function drawPicker(x, y) {
                  if(!jscolor.picker) {
                      jscolor.picker = {
                          box : document.createElement('div'),
                          boxB : document.createElement('div'),
      Severity: Major
      Found in app/assets/javascripts/jscolor.js - About 7 hrs to fix

        Function URI has 91 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            URI : function(uri) { // See RFC3986
        
                this.scheme = null;
                this.authority = null;
                this.path = '';
        Severity: Major
        Found in app/assets/javascripts/jscolor.js - About 3 hrs to fix

          Function toAbsolute has 44 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  this.toAbsolute = function(base) {
                      var base = new jscolor.URI(base);
                      var r = this;
                      var t = new jscolor.URI;
          
          
          Severity: Minor
          Found in app/assets/javascripts/jscolor.js - About 1 hr to fix

            Function redrawPad has 44 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                    function redrawPad() {
                        // redraw the pad pointer
                        switch(modeID) {
                            case 0: var yComponent = 1; break;
                            case 1: var yComponent = 2; break;
            Severity: Minor
            Found in app/assets/javascripts/jscolor.js - About 1 hr to fix

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

                  bind : function() {
                      var matchClass = new RegExp('(^|\\s)('+jscolor.bindClass+')(\\s*(\\{[^}]*\\})|\\s|$)', 'i');
                      var e = document.getElementsByTagName('input');
                      for(var i=0; i<e.length; i+=1) {
                          var m;
              Severity: Minor
              Found in app/assets/javascripts/jscolor.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 showPicker has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      this.showPicker = function() {
                          if(!isPickerOwner()) {
                              var tp = jscolor.getElementPos(target); // target pos
                              var ts = jscolor.getElementSize(target); // target size
                              var vp = jscolor.getViewPos(); // view pos
              Severity: Minor
              Found in app/assets/javascripts/jscolor.js - About 1 hr to fix

                Function getViewSize has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                Open

                    getViewSize : function() {
                        if(typeof window.innerWidth === 'number') {
                            return [window.innerWidth, window.innerHeight];
                        } else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
                            return [document.body.clientWidth, document.body.clientHeight];
                Severity: Minor
                Found in app/assets/javascripts/jscolor.js - About 45 mins 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

                Avoid deeply nested control flow statements.
                Open

                                            if(base.authority !== null && base.path === '') {
                                                t.path = '/'+r.path;
                                            } else {
                                                t.path = base.path.replace(/[^\/]+$/,'')+r.path;
                                            }
                Severity: Major
                Found in app/assets/javascripts/jscolor.js - About 45 mins to fix

                  Function detectDir has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      detectDir : function() {
                          var base = location.href;
                  
                          var e = document.getElementsByTagName('base');
                          for(var i=0; i<e.length; i+=1) {
                  Severity: Minor
                  Found in app/assets/javascripts/jscolor.js - About 35 mins 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 getViewPos has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                  Open

                      getViewPos : function() {
                          if(typeof window.pageYOffset === 'number') {
                              return [window.pageXOffset, window.pageYOffset];
                          } else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
                              return [document.body.scrollLeft, document.body.scrollTop];
                  Severity: Minor
                  Found in app/assets/javascripts/jscolor.js - About 35 mins 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

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

                      getViewSize : function() {
                          if(typeof window.innerWidth === 'number') {
                              return [window.innerWidth, window.innerHeight];
                          } else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
                              return [document.body.clientWidth, document.body.clientHeight];
                  Severity: Major
                  Found in app/assets/javascripts/jscolor.js and 1 other location - About 6 hrs to fix
                  app/assets/javascripts/jscolor.js on lines 189..199

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

                  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

                      getViewPos : function() {
                          if(typeof window.pageYOffset === 'number') {
                              return [window.pageXOffset, window.pageYOffset];
                          } else if(document.body && (document.body.scrollLeft || document.body.scrollTop)) {
                              return [document.body.scrollLeft, document.body.scrollTop];
                  Severity: Major
                  Found in app/assets/javascripts/jscolor.js and 1 other location - About 6 hrs to fix
                  app/assets/javascripts/jscolor.js on lines 202..212

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

                  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('ontouchstart' in window) {
                                  p.padM.addEventListener('touchstart', function(e) {
                                      touchOffset={
                                          'X': e.target.offsetParent.offsetLeft,
                                          'Y': e.target.offsetParent.offsetTop
                  Severity: Major
                  Found in app/assets/javascripts/jscolor.js and 1 other location - About 4 hrs to fix
                  app/assets/javascripts/jscolor.js on lines 681..692

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

                  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('ontouchstart' in window) {
                                  p.sldM.addEventListener('touchstart', function(e) {
                                      touchOffset={
                                          'X': e.target.offsetParent.offsetLeft,
                                          'Y': e.target.offsetParent.offsetTop
                  Severity: Major
                  Found in app/assets/javascripts/jscolor.js and 1 other location - About 4 hrs to fix
                  app/assets/javascripts/jscolor.js on lines 661..672

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

                  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

                              this.hsv[2] = hsv[2]===null ? null : Math.max(0.0, this.minV, Math.min(1.0, this.maxV, hsv[2]));
                  Severity: Major
                  Found in app/assets/javascripts/jscolor.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/jscolor.js on lines 497..497

                  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

                                  this.hsv[1] = hsv[1]===null ? null : Math.max(0.0, this.minS, Math.min(1.0, this.maxS, hsv[1]));
                  Severity: Major
                  Found in app/assets/javascripts/jscolor.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/jscolor.js on lines 499..499

                  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

                              p.sldM.onmouseup =
                              p.sldM.onmouseout = function() { if(holdSld) { holdSld=false; jscolor.fireEvent(valueElement,'change'); } };
                  Severity: Major
                  Found in app/assets/javascripts/jscolor.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/jscolor.js on lines 648..649

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

                  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

                              p.padM.onmouseup =
                              p.padM.onmouseout = function() { if(holdPad) { holdPad=false; jscolor.fireEvent(valueElement,'change'); } };
                  Severity: Major
                  Found in app/assets/javascripts/jscolor.js and 1 other location - About 1 hr to fix
                  app/assets/javascripts/jscolor.js on lines 673..674

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

                  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

                              var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.pad[1]-1));
                  Severity: Minor
                  Found in app/assets/javascripts/jscolor.js and 1 other location - About 35 mins to fix
                  app/assets/javascripts/jscolor.js on lines 873..873

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

                  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

                              var y = Math.round((1-THIS.hsv[yComponent]) * (jscolor.images.sld[1]-1));
                  Severity: Minor
                  Found in app/assets/javascripts/jscolor.js and 1 other location - About 35 mins to fix
                  app/assets/javascripts/jscolor.js on lines 822..822

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

                  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(s !== null) { s = Math.max(0.0, this.minS, Math.min(1.0, this.maxS, s)); }
                  Severity: Minor
                  Found in app/assets/javascripts/jscolor.js and 1 other location - About 35 mins to fix
                  app/assets/javascripts/jscolor.js on lines 471..471

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

                  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

                                  (THIS.pickerFace+THIS.pickerInset+x - Math.floor(jscolor.images.cross[0]/2)) + 'px ' +
                                  (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.cross[1]/2)) + 'px';
                  Severity: Minor
                  Found in app/assets/javascripts/jscolor.js and 1 other location - About 35 mins to fix
                  app/assets/javascripts/jscolor.js on lines 875..875

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

                  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

                                  '0 ' + (THIS.pickerFace+THIS.pickerInset+y - Math.floor(jscolor.images.arrow[1]/2)) + 'px';
                  Severity: Minor
                  Found in app/assets/javascripts/jscolor.js and 1 other location - About 35 mins to fix
                  app/assets/javascripts/jscolor.js on lines 824..825

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

                  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(v !== null) { v = Math.max(0.0, this.minV, Math.min(1.0, this.maxV, v)); }
                  Severity: Minor
                  Found in app/assets/javascripts/jscolor.js and 1 other location - About 35 mins to fix
                  app/assets/javascripts/jscolor.js on lines 470..470

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

                  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

                  There are no issues that match your filters.

                  Category
                  Status