myems-admin/js/plugins/jsKnob/jquery.knob.js

Summary

Maintainability
F
6 days
Test Coverage

Function o has 332 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    k.o = function () {
        var s = this;

        this.o = null; // array of options
        this.$ = null; // jQuery wrapped element
Severity: Major
Found in myems-admin/js/plugins/jsKnob/jquery.knob.js - About 1 day to fix

    File jquery.knob.js has 582 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    /*!jQuery Knob*/
    /**
     * Downward compatible, touchable dial
     *
     * Version: 1.2.8
    Severity: Major
    Found in myems-admin/js/plugins/jsKnob/jquery.knob.js - About 1 day to fix

      Function Dial has 225 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          k.Dial = function () {
              k.o.call(this);
      
              this.startAngle = null;
              this.xy = null;
      Severity: Major
      Found in myems-admin/js/plugins/jsKnob/jquery.knob.js - About 1 day to fix

        Function run has 134 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                this.run = function () {
                    var cf = function (e, conf) {
                        var k;
                        for (k in conf) {
                            s.o[k] = conf[k];
        Severity: Major
        Found in myems-admin/js/plugins/jsKnob/jquery.knob.js - About 5 hrs to fix

          Function listen has 72 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  this.listen = function () {
                      // bind MouseWheel
                      var s = this, mwTimerStop, mwTimerRelease,
                          mw = function (e) {
                              e.preventDefault();
          Severity: Major
          Found in myems-admin/js/plugins/jsKnob/jquery.knob.js - About 2 hrs to fix

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

                    this.init = function () {
            
                        if (
                            this.v < this.o.min
                                || this.v > this.o.max
            Severity: Minor
            Found in myems-admin/js/plugins/jsKnob/jquery.knob.js - About 1 hr to fix

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

                      this._mouse = function (e) {
              
                          var mouseMove = function (e) {
                              var v = s.xy2val(e.pageX, e.pageY);
              
              
              Severity: Minor
              Found in myems-admin/js/plugins/jsKnob/jquery.knob.js - About 1 hr to fix

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

                        this._carve = function() {
                            if(this.relative) {
                                var w = this.relativeWidth ?
                                        this.$div.parent().width() *
                                            parseInt(this.o.width) / 100 :
                Severity: Minor
                Found in myems-admin/js/plugins/jsKnob/jquery.knob.js - About 1 hr to fix

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

                          this._listen = function () {
                  
                              if (!this.o.readOnly) {
                                  this.$c
                                      .bind(
                  Severity: Minor
                  Found in myems-admin/js/plugins/jsKnob/jquery.knob.js - About 1 hr to fix

                    Consider simplifying this complex logical expression.
                    Open

                                        if (isNaN(kval)) {
                    
                                            (kc !== 13)         // enter
                                                && (kc !== 8)       // bs
                                                && (kc !== 9)       // tab
                    Severity: Major
                    Found in myems-admin/js/plugins/jsKnob/jquery.knob.js - About 1 hr to fix

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

                                          h = this.relativeHeight ?
                                              this.$div.parent().height() *
                                                  parseInt(this.o.height) / 100 :
                                              this.$div.parent().height();
                      Severity: Major
                      Found in myems-admin/js/plugins/jsKnob/jquery.knob.js and 1 other location - About 1 hr to fix
                      myems-admin/js/plugins/jsKnob/jquery.knob.js on lines 257..260

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

                      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 w = this.relativeWidth ?
                                              this.$div.parent().width() *
                                                  parseInt(this.o.width) / 100 :
                                              this.$div.parent().width(),
                      Severity: Major
                      Found in myems-admin/js/plugins/jsKnob/jquery.knob.js and 1 other location - About 1 hr to fix
                      myems-admin/js/plugins/jsKnob/jquery.knob.js on lines 261..264

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

                      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

                                              (s.$.val() > s.o.max && s.$.val(s.o.max))
                      Severity: Minor
                      Found in myems-admin/js/plugins/jsKnob/jquery.knob.js and 1 other location - About 40 mins to fix
                      myems-admin/js/plugins/jsKnob/jquery.knob.js on lines 649..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 48.

                      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

                                              || (s.$.val() < s.o.min && s.$.val(s.o.min));
                      Severity: Minor
                      Found in myems-admin/js/plugins/jsKnob/jquery.knob.js and 1 other location - About 40 mins to fix
                      myems-admin/js/plugins/jsKnob/jquery.knob.js on lines 648..648

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

                      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

                                  rgb = [parseInt(h.substring(0,2),16)
                                      ,parseInt(h.substring(2,4),16)
                                      ,parseInt(h.substring(4,6),16)];
                      Severity: Minor
                      Found in myems-admin/js/plugins/jsKnob/jquery.knob.js and 1 other location - About 35 mins to fix
                      myems-admin/js/plugins/jvectormap/jquery-jvectormap-2.0.2.min.js on lines 1440..1440

                      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

                                  this.relativeWidth = ((this.o.width % 1 !== 0) &&
                                      this.o.width.indexOf('%'));
                      Severity: Minor
                      Found in myems-admin/js/plugins/jsKnob/jquery.knob.js and 1 other location - About 35 mins to fix
                      myems-admin/js/plugins/jsKnob/jquery.knob.js on lines 220..221

                      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.relativeHeight = ((this.o.height % 1 !== 0) &&
                                      this.o.height.indexOf('%'));
                      Severity: Minor
                      Found in myems-admin/js/plugins/jsKnob/jquery.knob.js and 1 other location - About 35 mins to fix
                      myems-admin/js/plugins/jsKnob/jquery.knob.js on lines 218..219

                      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