cjtterabytesoft/yii2-jvectormap

View on GitHub

Showing 117 of 117 total issues

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

              scale = Math.sqrt(
                Math.pow(touches[0].pageX - touches[1].pageX, 2) +
                Math.pow(touches[0].pageY - touches[1].pageY, 2)
              ) / touchStartDistance;
Severity: Major
Found in assets/js/jquery-jvectormap.min.js and 1 other location - About 1 hr to fix
assets/js/jquery-jvectormap.min.js on lines 2457..2460

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

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

              touchStartDistance = Math.sqrt(
                Math.pow(touches[0].pageX - touches[1].pageX, 2) +
                Math.pow(touches[0].pageY - touches[1].pageY, 2)
              );
Severity: Major
Found in assets/js/jquery-jvectormap.min.js and 1 other location - About 1 hr to fix
assets/js/jquery-jvectormap.min.js on lines 2431..2434

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

Method run has 45 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function run()
    {
        if ($this->jverror == 0) {
            $this->config = Json::encode(
                [
Severity: Minor
Found in JvectorMap.php - About 1 hr to fix

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

    jvm.AbstractCanvasElement.prototype.addText = function(config, style, group){
      var el = new jvm[this.classPrefix+'TextElement'](config, style);
    
      this.add(el, group);
      return el;
    Severity: Major
    Found in assets/js/jquery-jvectormap.min.js and 3 other locations - About 1 hr to fix
    assets/js/jquery-jvectormap.min.js on lines 533..538
    assets/js/jquery-jvectormap.min.js on lines 546..551
    assets/js/jquery-jvectormap.min.js on lines 559..564

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    jvm.AbstractCanvasElement.prototype.addImage = function(config, style, group){
      var el = new jvm[this.classPrefix+'ImageElement'](config, style);
    
      this.add(el, group);
      return el;
    Severity: Major
    Found in assets/js/jquery-jvectormap.min.js and 3 other locations - About 1 hr to fix
    assets/js/jquery-jvectormap.min.js on lines 533..538
    assets/js/jquery-jvectormap.min.js on lines 546..551
    assets/js/jquery-jvectormap.min.js on lines 572..577

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    jvm.AbstractCanvasElement.prototype.addCircle = function(config, style, group){
      var el = new jvm[this.classPrefix+'CircleElement'](config, style);
    
      this.add(el, group);
      return el;
    Severity: Major
    Found in assets/js/jquery-jvectormap.min.js and 3 other locations - About 1 hr to fix
    assets/js/jquery-jvectormap.min.js on lines 533..538
    assets/js/jquery-jvectormap.min.js on lines 559..564
    assets/js/jquery-jvectormap.min.js on lines 572..577

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

    jvm.AbstractCanvasElement.prototype.addPath = function(config, style, group){
      var el = new jvm[this.classPrefix+'PathElement'](config, style);
    
      this.add(el, group);
      return el;
    Severity: Major
    Found in assets/js/jquery-jvectormap.min.js and 3 other locations - About 1 hr to fix
    assets/js/jquery-jvectormap.min.js on lines 546..551
    assets/js/jquery-jvectormap.min.js on lines 559..564
    assets/js/jquery-jvectormap.min.js on lines 572..577

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

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function createMarkers has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      createMarkers: function(markers) {
        var i,
            marker,
            point,
            markerConfig,
    Severity: Minor
    Found in assets/js/jquery-jvectormap.min.js - About 1 hr to fix

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

            point.x = (point.x - bbox[0].x) / (bbox[1].x - bbox[0].x) * inset.width * this.scale;
      Severity: Major
      Found in assets/js/jquery-jvectormap.min.js and 1 other location - About 1 hr to fix
      assets/js/jquery-jvectormap.min.js on lines 3059..3059

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

      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

            point.y = (point.y - bbox[0].y) / (bbox[1].y - bbox[0].y) * inset.height * this.scale;
      Severity: Major
      Found in assets/js/jquery-jvectormap.min.js and 1 other location - About 1 hr to fix
      assets/js/jquery-jvectormap.min.js on lines 3058..3058

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

      We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

      The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

      If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

      See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

      Refactorings

      Further Reading

      Function getValue has 38 lines of code (exceeds 25 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 1 hr to fix

        Function bindContainerEvents has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          bindContainerEvents: function(){
            var mouseDown = false,
                oldPageX,
                oldPageY,
                map = this;
        Severity: Minor
        Found in assets/js/jquery-jvectormap.min.js - About 1 hr to fix

          Function min has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            min: function(values){
              var min = Number.MAX_VALUE,
                  i;
          
              if (values instanceof Array) {
          Severity: Minor
          Found in assets/js/jquery-jvectormap.min.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 max has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
          Open

            max: function(values){
              var max = Number.MIN_VALUE,
                  i;
          
              if (values instanceof Array) {
          Severity: Minor
          Found in assets/js/jquery-jvectormap.min.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 bindContainerPointerEvents has 35 lines of code (exceeds 25 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 1 hr to fix

            Function applyTransform has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              applyTransform: function() {
                var maxTransX,
                    maxTransY,
                    minTransX,
                    minTransY;
            Severity: Minor
            Found in assets/js/jquery-jvectormap.min.js - About 1 hr to fix

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

                    if (nx > bbox[0].x && nx < bbox[1].x && ny > bbox[0].y && ny < bbox[1].y) {
                      return jvm.Proj[proj.type + '_inv'](nx, -ny, centralMeridian);
                    }
              Severity: Major
              Found in assets/js/jquery-jvectormap.min.js and 1 other location - About 1 hr to fix
              assets/js/jquery-jvectormap.min.js on lines 3110..3112

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

              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 (x > bbox[0].x && x < bbox[1].x && y > bbox[0].y && y < bbox[1].y) {
                      return insets[i];
                    }
              Severity: Major
              Found in assets/js/jquery-jvectormap.min.js and 1 other location - About 1 hr to fix
              assets/js/jquery-jvectormap.min.js on lines 3095..3097

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

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Function applyAttr has 32 lines of code (exceeds 25 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 1 hr to fix

                Function applyAttr has 31 lines of code (exceeds 25 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 1 hr to fix
                  Severity
                  Category
                  Status
                  Source
                  Language