howardjones/network-weathermap

View on GitHub

Showing 1,091 of 1,093 total issues

Avoid too many return statements within this method.
Open

        return false;
Severity: Major
Found in lib/Weathermap/Plugins/Datasources/CactiDSStats.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

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

      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 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 $this->getLink($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 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 $this->drawLegendClassic(true);
                Severity: Major
                Found in lib/Weathermap/Core/Legend.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 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 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 sprintf("%d:%d", $xOffset, $yOffset);
                          Severity: Major
                          Found in lib/Weathermap/Editor/Editor.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

                              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 handleLINK has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private function handleLINK($fullcommand, $args, $matches)
                                  {
                                      $this->commitItem();
                                      unset($this->currentObject);
                              
                              
                              Severity: Minor
                              Found in lib/Weathermap/Core/ConfigReader.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 addPoint has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public function addPoint($x, $y)
                                  {
                                      MapUtility::debug("Adding point $x,$y to '$this->name'\n");
                              
                                      if (is_null($this->minimumX) || $x < $this->minimumX) {
                              Severity: Minor
                              Found in lib/Weathermap/Core/BoundingBox.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 wmeValidateOneOf has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  public static function wmeValidateOneOf($input, $validChoices = array(), $caseSensitive = false)
                                  {
                                      if (!$caseSensitive) {
                                          $input = strtolower($input);
                                      }
                              Severity: Minor
                              Found in lib/Weathermap/UI/UIBase.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 handleTEMPLATE has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                              Open

                                  private function handleTEMPLATE($fullcommand, $args, $matches)
                                  {
                                      $templateName = $matches[1];
                              
                                      if (($this->currentType == 'NODE' && isset($this->mapObject->nodes[$templateName]))
                              Severity: Minor
                              Found in lib/Weathermap/Core/ConfigReader.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 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

                              Severity
                              Category
                              Status
                              Source
                              Language