cjtterabytesoft/yii2-jvectormap

View on GitHub

Showing 54 of 117 total issues

File jquery-jvectormap.min.js has 2562 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * jVectorMap version 2.0.4
 *
 * Copyright 2011-2014, Kirill Lebedev
 *
Severity: Major
Found in assets/js/jquery-jvectormap.min.js - About 1 wk to fix

    Function setValues has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring.
    Open

      setValues: function(values) {
        var max = -Number.MAX_VALUE,
            min = Number.MAX_VALUE,
            val,
            cc,
    Severity: Minor
    Found in assets/js/jquery-jvectormap.min.js - About 5 hrs 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

    prototype has 38 functions (exceeds 20 allowed). Consider refactoring.
    Open

    jvm.Map.prototype = {
      transX: 0,
      transY: 0,
      scale: 1,
      baseTransX: 0,
    Severity: Minor
    Found in assets/js/jquery-jvectormap.min.js - About 5 hrs to fix

      Function bindContainerTouchEvents has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
      Open

        bindContainerTouchEvents: function(){
          var touchStartScale,
              touchStartDistance,
              map = this,
              touchX,
      Severity: Minor
      Found in assets/js/jquery-jvectormap.min.js - About 3 hrs 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 setFocus has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

        setFocus: function(config){
          var bbox,
              itemBbox,
              newBbox,
              codes,
      Severity: Minor
      Found in assets/js/jquery-jvectormap.min.js - About 3 hrs 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 pathSvgToVml has 71 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      jvm.VMLPathElement.pathSvgToVml = function(path) {
        var cx = 0, cy = 0, ctrlx, ctrly;
      
        path = path.replace(/(-?\d+)e(-?\d+)/g, '0');
        return path.replace(/([MmLlHhVvCcSs])\s*((?:-?\d*(?:\.\d+)?\s*,?\s*)+)/g, function(segment, letter, coords, index){
      Severity: Major
      Found in assets/js/jquery-jvectormap.min.js - About 2 hrs to fix

        Function bindContainerTouchEvents has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          bindContainerTouchEvents: function(){
            var touchStartScale,
                touchStartDistance,
                map = this,
                touchX,
        Severity: Major
        Found in assets/js/jquery-jvectormap.min.js - About 2 hrs to fix

          Function Map has 66 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          jvm.Map = function(params) {
            var map = this,
                e;
          
            this.params = jvm.$.extend(true, {}, jvm.Map.defaultParams, params);
          Severity: Major
          Found in assets/js/jquery-jvectormap.min.js - About 2 hrs to fix

            Function Map has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
            Open

            jvm.Map = function(params) {
              var map = this,
                  e;
            
              this.params = jvm.$.extend(true, {}, jvm.Map.defaultParams, params);
            Severity: Minor
            Found in assets/js/jquery-jvectormap.min.js - About 2 hrs 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 handler has 60 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                function handler(event) {
                    var orgEvent   = event || window.event,
                        args       = slice.call(arguments, 1),
                        delta      = 0,
                        deltaX     = 0,
            Severity: Major
            Found in assets/js/jquery-jvectormap.min.js - About 2 hrs to fix

              Function bindElementEvents has 58 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                bindElementEvents: function(){
                  var map = this,
                      pageX,
                      pageY,
                      mouseMoved;
              Severity: Major
              Found in assets/js/jquery-jvectormap.min.js - About 2 hrs to fix

                Function setScale has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  setScale: function(scale, anchorX, anchorY, isCentered, animate) {
                    var viewportChangeEvent = jvm.$.Event('zoom.jvectormap'),
                        interval,
                        that = this,
                        i = 0,
                Severity: Major
                Found in assets/js/jquery-jvectormap.min.js - About 2 hrs to fix

                  Function handleTouchEvent has 57 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                          handleTouchEvent = function(e){
                            var touches = e.originalEvent.touches,
                                offset,
                                scale,
                                transXOld,
                  Severity: Major
                  Found in assets/js/jquery-jvectormap.min.js - About 2 hrs to fix

                    Function indexOf has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                      Array.prototype.indexOf = function (searchElement, fromIndex) {
                    
                        var k;
                    
                        // 1. Let O be the result of calling ToObject passing
                    Severity: Minor
                    Found in assets/js/jquery-jvectormap.min.js - About 2 hrs 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 createMarkers has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                    Open

                      createMarkers: function(markers) {
                        var i,
                            marker,
                            point,
                            markerConfig,
                    Severity: Minor
                    Found in assets/js/jquery-jvectormap.min.js - About 2 hrs 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 render has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    jvm.Legend.prototype.render = function(){
                      var ticks = this.series.scale.getTicks(),
                          i,
                          inner = jvm.$('<div/>').addClass('jvectormap-legend-inner'),
                          tick,
                    Severity: Minor
                    Found in assets/js/jquery-jvectormap.min.js - About 2 hrs to fix

                      Function setFocus has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        setFocus: function(config){
                          var bbox,
                              itemBbox,
                              newBbox,
                              codes,
                      Severity: Minor
                      Found in assets/js/jquery-jvectormap.min.js - About 1 hr to fix

                        Function setValues has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          setValues: function(values) {
                            var max = -Number.MAX_VALUE,
                                min = Number.MAX_VALUE,
                                val,
                                cc,
                        Severity: Minor
                        Found in assets/js/jquery-jvectormap.min.js - About 1 hr to fix

                          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

                            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
                              Severity
                              Category
                              Status
                              Source
                              Language