howardjones/network-weathermap

View on GitHub

Showing 380 of 1,093 total issues

Avoid too many return statements within this method.
Open

        return false;
Severity: Major
Found in lib/Weathermap/Core/Utility.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

            return array(0, 0);
    Severity: Major
    Found in lib/Weathermap/Core/MapUtility.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

                      return $mid;
      Severity: Major
      Found in lib/Weathermap/Core/Spine.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                return false;
        Severity: Major
        Found in lib/Weathermap/Core/ConfigReader.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return null;
          Severity: Major
          Found in lib/Weathermap/Core/Map.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                    return array($xOffset, $yOffset, $nodeName, $endOffset, false);
            Severity: Major
            Found in lib/Weathermap/Core/ConfigReader.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                          return $this->getNode($itemname);
              Severity: Major
              Found in lib/Weathermap/Core/Map.php - About 30 mins to fix

                Avoid too many return statements within this method.
                Open

                                    return true;
                Severity: Major
                Found in lib/Weathermap/Core/Utility.php - About 30 mins to fix

                  Avoid too many return statements within this method.
                  Open

                                  return "E95";
                  Severity: Major
                  Found in lib/Weathermap/Editor/Editor.php - About 30 mins to fix

                    Avoid too many return statements within this method.
                    Open

                            return sprintf("%d:%d", $xOffset, $yOffset);
                    Severity: Major
                    Found in lib/Weathermap/Editor/Editor.php - About 30 mins to fix

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

                          public function writeDataFile($filename)
                          {
                              if ($filename == '') {
                                  return;
                              }
                      Severity: Minor
                      Found in lib/Weathermap/Core/Map.php - 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

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

                          private function drawTimestamp($imageRef, $font, $colour, $which = '')
                          {
                              // add a timestamp to the corner, so we can tell if it's all being updated
                      
                              $fontObject = $this->fonts->getFont($font);
                      Severity: Minor
                      Found in lib/Weathermap/Core/Map.php - 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

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

                          private function replicateLegendSettings()
                          {
                              foreach ($this->legends as $scaleName => $legendObject) {
                                  // These are currently global settings for a map, not per-scale
                                  $legendObject->keyoutlinecolour = $this->colourtable['KEYOUTLINE'];
                      Severity: Minor
                      Found in lib/Weathermap/Core/Map.php - 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

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

                      function make_target_string($local_data_id, $dsnames, $multiply, $multiplier)
                      {
                          $new_target = sprintf("dsstats:%d:%s:%s", $local_data_id, $dsnames[IN], $dsnames[OUT]);
                          $m = $multiply * $multiplier;
                      
                      
                      Severity: Minor
                      Found in random-bits/convert-to-dsstats.php - 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

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

                      function help_handler(e) {
                          var objectid = jQuery(this).attr('id');
                          var section = objectid.slice(0, objectid.indexOf('_'));
                          var target = section + '_help';
                          var helptext = "undefined";
                      Severity: Minor
                      Found in editor-resources/editor.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

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

                          protected function loadBackgroundImage()
                          {
                              $bgImageRef = null;
                      
                              // do the basic prep work
                      Severity: Minor
                      Found in lib/Weathermap/Core/Map.php - 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

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

                      function getUrlParameter(sParam) {
                          var sPageURL = decodeURIComponent(window.location.search.substring(1)),
                              sURLVariables = sPageURL.split('&'),
                              sParameterName,
                              i;
                      Severity: Minor
                      Found in editor-resources/cacti-pick.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

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

                          private function processStringToken($includeNotes, $keyContents, $key, $context)
                          {
                              $value = '[UNKNOWN]';
                              $format = "";
                              $theItem = null;
                      Severity: Minor
                      Found in lib/Weathermap/Core/Map.php - 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

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

                          private function buildOverlibPositioning($mapItem, $midX, $mapCenterX, $midY, $mapCenterY)
                          {
                              $left = '';
                              $above = '';
                              $imageExtraHTML = '';
                      Severity: Minor
                      Found in lib/Weathermap/Core/Map.php - 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

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

                      function getNodeFromID(id) {
                          for (var nodename in mapdata.Nodes) {
                              if (mapdata.Nodes.hasOwnProperty(nodename)) {
                                  var node = mapdata.Nodes[nodename];
                                  if (node.id === id) {
                      Severity: Minor
                      Found in editor-resources/editor.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