PowerPan/leaflet.mouseCoordinate

View on GitHub

Showing 17 of 31 total issues

Function fromLatLng has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring.
Open

    fromLatLng: function(latlng){
        /* Long/Lat to QTH locator conversion largely       */
        /* inspired from the DL4MFM code found here :       */
        /* http://members.aol.com/mfietz/ham/calcloce.html */

Severity: Minor
Found in src/qth.js - About 7 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 fromLatLng has 96 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    fromLatLng: function (latlng) {
        //Copyright (c) 2006, HELMUT H. HEIMEIER

        /*
         * Okay, this just gives the wrong result:
Severity: Major
Found in src/utm.js - About 3 hrs to fix

    Function fromLatLng has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        fromLatLng: function (latlng) {
            //Copyright (c) 2006, HELMUT H. HEIMEIER
    
            /*
             * Okay, this just gives the wrong result:
    Severity: Minor
    Found in src/utm.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 toLatLng has 64 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        toLatLng: function (utm){
            // Copyright (c) 2006, HELMUT H. HEIMEIER
    
            var zone = utm.zone;
            var ew = utm.x;
    Severity: Major
    Found in src/utm.js - About 2 hrs to fix

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

      module.exports = function (grunt) {
      
          // Project configuration.
          grunt.initConfig({
              pkg: grunt.file.readJSON('package.json'),
      Severity: Major
      Found in Gruntfile.js - About 2 hrs to fix

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

            fromLatLng: function(latlng){
                /* Long/Lat to QTH locator conversion largely       */
                /* inspired from the DL4MFM code found here :       */
                /* http://members.aol.com/mfietz/ham/calcloce.html */
        
        
        Severity: Minor
        Found in src/qth.js - About 1 hr to fix

          Function _update has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _update: function(e){
                  //lat: [-90,90]
                  //lng: [-180,180]
                  var lat = (e.latlng.lat+90)%180;
                  var lng = (e.latlng.lng+180)%360;
          Severity: Minor
          Found in src/leaflet.mouseCoordinate.js - About 1 hr to fix

            Function fromUTM has 43 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                fromUTM: function (utm) {
                    // Copyright (c) 2006, HELMUT H. HEIMEIER
            
                    if(utm === undefined){
                        return;
            Severity: Minor
            Found in src/utmref.js - About 1 hr to fix

              Function _update has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
              Open

                  _update: function(e){
                      //lat: [-90,90]
                      //lng: [-180,180]
                      var lat = (e.latlng.lat+90)%180;
                      var lng = (e.latlng.lng+180)%360;
              Severity: Minor
              Found in src/leaflet.mouseCoordinate.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 toUTM has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  toUTM: function (mgr) {
                      // Copyright (c) 2006, HELMUT H. HEIMEIER
              
                      // Laengenzone zone, Ostwert ew und Nordwert nw im WGS84 Datum
                      var m_east_0 = "STUVWXYZ";
              Severity: Minor
              Found in src/utmref.js - About 1 hr to fix

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

                    fromLatLng: function(latlng) {
                
                        var lat = latlng.lat;
                        var lon = latlng.lng;
                        var x = [];
                Severity: Minor
                Found in src/nac.js - About 1 hr to fix

                  Avoid deeply nested control flow statements.
                  Open

                                          if (yk === 2) ydiv = 1;
                  Severity: Major
                  Found in src/qth.js - About 45 mins to fix

                    Avoid deeply nested control flow statements.
                    Open

                                            if (yk === 1) ydiv = 20;
                    Severity: Major
                    Found in src/qth.js - About 45 mins to fix

                      Avoid deeply nested control flow statements.
                      Open

                                              if (yk === 1) ydiv = 10;
                      Severity: Major
                      Found in src/qth.js - About 45 mins to fix

                        Function fromUTM has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                        Open

                            fromUTM: function (utm) {
                                // Copyright (c) 2006, HELMUT H. HEIMEIER
                        
                                if(utm === undefined){
                                    return;
                        Severity: Minor
                        Found in src/utmref.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

                        Avoid deeply nested control flow statements.
                        Open

                                                if (yk === 2) ydiv = 2;
                        Severity: Major
                        Found in src/qth.js - About 45 mins to fix

                          Function fromLatLng has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                          Open

                              fromLatLng: function(latlng) {
                          
                                  var lat = latlng.lat;
                                  var lon = latlng.lng;
                                  var x = [];
                          Severity: Minor
                          Found in src/nac.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

                          Severity
                          Category
                          Status
                          Source
                          Language