mambax7/pedigree

View on GitHub
assets/js/jscolor/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 assets/js/jscolor/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 670 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 assets/js/jscolor/jscolor.js - About 3 days to fix

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

    /**
     * jscolor, JavaScript Color Picker
     *
     * @version 1.4.3
     * @license GNU Lesser General Public License, https://www.gnu.org/copyleft/lesser.html
    Severity: Major
    Found in assets/js/jscolor/jscolor.js - About 2 days 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 assets/js/jscolor/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 219 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 assets/js/jscolor/jscolor.js - About 1 day to fix

        Function URI has 103 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 assets/js/jscolor/jscolor.js - About 4 hrs to fix

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

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

            Function showPicker has 47 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 assets/js/jscolor/jscolor.js - About 1 hr to fix

              Function toAbsolute has 46 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 assets/js/jscolor/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 assets/js/jscolor/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 fromRGB has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                        this.fromRGB = function (r, g, b, flags) { // null = don't change
                            if (r !== null) {
                                r = Math.max(0.0, Math.min(1.0, r));
                            }
                            if (g !== null) {
                Severity: Minor
                Found in assets/js/jscolor/jscolor.js - About 1 hr to fix

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

                          this.exportColor = function (flags) {
                              if (!(flags && leaveValue) && valueElement) {
                                  var value = this.toString();
                                  if (this.caps) {
                                      value = value.toUpperCase();
                  Severity: Minor
                  Found in assets/js/jscolor/jscolor.js - About 1 hr to fix

                    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 assets/js/jscolor/jscolor.js - About 45 mins 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 assets/js/jscolor/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

                      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 assets/js/jscolor/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 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 assets/js/jscolor/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 assets/js/jscolor/jscolor.js and 1 other location - About 6 hrs to fix
                      assets/js/jscolor/jscolor.js on lines 193..203

                      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 assets/js/jscolor/jscolor.js and 1 other location - About 6 hrs to fix
                      assets/js/jscolor/jscolor.js on lines 206..216

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

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

                      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[1] = hsv[1] === null ? null : Math.max(0.0, this.minS, Math.min(1.0, this.maxS, hsv[1]));
                      Severity: Major
                      Found in assets/js/jscolor/jscolor.js and 1 other location - About 1 hr to fix
                      assets/js/jscolor/jscolor.js on lines 547..547

                      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[2] = hsv[2] === null ? null : Math.max(0.0, this.minV, Math.min(1.0, this.maxV, hsv[2]));
                      Severity: Major
                      Found in assets/js/jscolor/jscolor.js and 1 other location - About 1 hr to fix
                      assets/js/jscolor/jscolor.js on lines 545..545

                      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 assets/js/jscolor/jscolor.js and 1 other location - About 1 hr to fix
                      assets/js/jscolor/jscolor.js on lines 710..716

                      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 assets/js/jscolor/jscolor.js and 1 other location - About 1 hr to fix
                      assets/js/jscolor/jscolor.js on lines 748..754

                      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.sld[1] - 1));
                      Severity: Minor
                      Found in assets/js/jscolor/jscolor.js and 1 other location - About 35 mins to fix
                      assets/js/jscolor/jscolor.js on lines 911..911

                      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.pad[1] - 1));
                      Severity: Minor
                      Found in assets/js/jscolor/jscolor.js and 1 other location - About 35 mins to fix
                      assets/js/jscolor/jscolor.js on lines 978..978

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

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

                      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 assets/js/jscolor/jscolor.js and 1 other location - About 35 mins to fix
                      assets/js/jscolor/jscolor.js on lines 980..980

                      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 assets/js/jscolor/jscolor.js and 1 other location - About 35 mins to fix
                      assets/js/jscolor/jscolor.js on lines 913..914

                      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