cjtterabytesoft/yii2-jvectormap

View on GitHub

Showing 54 of 117 total issues

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

jvm.SVGShapeElement.prototype.applyAttr = function(attr, value){
  var patternEl,
      imageEl,
      that = this;

Severity: Minor
Found in assets/js/jquery-jvectormap.min.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 bindContainerPointerEvents has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  bindContainerPointerEvents: function(){
    var map = this,
        gesture = new MSGesture(),
        element = this.container[0],
        handlePointerDownEvent = function(e){
Severity: Minor
Found in assets/js/jquery-jvectormap.min.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 setSelected has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  setSelected: function(type, keys){
    var i;

    if (typeof keys != 'object') {
      keys = [keys];
Severity: Minor
Found in assets/js/jquery-jvectormap.min.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 applyAttr has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

jvm.VMLShapeElement.prototype.applyAttr = function(attr, value){
  switch (attr) {
    case 'fill':
      this.node.fillcolor = value;
      break;
Severity: Minor
Found in assets/js/jquery-jvectormap.min.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

Avoid too many return statements within this function.
Open

        return 'l'+cx+','+cy;
Severity: Major
Found in assets/js/jquery-jvectormap.min.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return 'v'+coords.join(',');
    Severity: Major
    Found in assets/js/jquery-jvectormap.min.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return 'r0,'+coords[0];
      Severity: Major
      Found in assets/js/jquery-jvectormap.min.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                return 'l'+cx+','+cy;
        Severity: Major
        Found in assets/js/jquery-jvectormap.min.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return 'v'+coords.join(',');
          Severity: Major
          Found in assets/js/jquery-jvectormap.min.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return 'c'+coords.join(',');
            Severity: Major
            Found in assets/js/jquery-jvectormap.min.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                      return 'r'+coords[0]+',0';
              Severity: Major
              Found in assets/js/jquery-jvectormap.min.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                        return 'c'+coords.join(',');
                Severity: Major
                Found in assets/js/jquery-jvectormap.min.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return '';
                  Severity: Major
                  Found in assets/js/jquery-jvectormap.min.js - About 30 mins to fix

                    Function getValue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      getValue: function(value) {
                        var lengthes = [],
                            fullLength = 0,
                            l,
                            i = 0,
                    Severity: Minor
                    Found in assets/js/jquery-jvectormap.min.js - About 25 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

                    Severity
                    Category
                    Status
                    Source
                    Language