howardjones/network-weathermap

View on GitHub

Showing 1,091 of 1,093 total issues

Method calculateAICONColours has 26 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    private function calculateAICONColours($labelColour, &$map)
    {
        $finalFillColour = new Colour('none');
        $finalInkColour = new Colour('none');

Severity: Minor
Found in lib/Weathermap/Core/MapNode.php - About 1 hr to fix

    Method init has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function init(&$map)
        {
            global $config;
    
            if ($map->context == 'cacti') {
    Severity: Minor
    Found in lib/Weathermap/Plugins/Datasources/RRDTool.php - About 1 hr to fix

      Method formatTimeTicks has 26 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function formatTimeTicks($value, $prefix, $tokenCharacter, $precision)
          {
              $joinCharacter = ' ';
              if ($prefix == '-') {
                  $joinCharacter = '';
      Severity: Minor
      Found in lib/Weathermap/Core/StringUtility.php - About 1 hr to fix

        Method readFromRealRRDtoolWithAggregate has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $rrdfile,
                $cf,
                $aggregatefn,
                $start,
                $end,
        Severity: Major
        Found in lib/Weathermap/Plugins/Datasources/RRDTool.php - About 1 hr to fix

          Method tidyComplexDimension has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $boundingBoxA,
                  $boundingBoxB,
                  $nodeA,
                  $nodeB,
                  $complexIndex,
          Severity: Major
          Found in lib/Weathermap/Editor/Editor.php - About 1 hr to fix

            Consider simplifying this complex logical expression.
            Open

                    if ($this->iconfile == 'rbox' || $this->iconfile == 'box' || $this->iconfile == 'round' || $this->iconfile == 'inpie' || $this->iconfile == 'outpie' || $this->iconfile == 'gauge' || $this->iconfile == 'nink') {
                        return true;
                    }
            Severity: Major
            Found in lib/Weathermap/Core/MapNode.php - About 1 hr to fix

              Function init has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function init(&$map)
                  {
                      global $config;
              
                      if ($map->context == 'cacti') {
              Severity: Minor
              Found in lib/Weathermap/Plugins/Datasources/RRDTool.php - About 55 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 collectDataFromTargets has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function collectDataFromTargets($channels)
                  {
                      $nFails = 0;
                      $dataTime = 0;
              
              
              Severity: Minor
              Found in lib/Weathermap/Core/MapDataItem.php - About 55 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 handleFONTDEFINE has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function handleFONTDEFINE($fullcommand, $args, $matches)
                  {
                      if (isset($args[3])) {
                          MapUtility::debug("New TrueType font in slot %d\n", $args[1]);
              
              
              Severity: Minor
              Found in lib/Weathermap/Core/ConfigReader.php - About 55 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 __construct has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function __construct()
                  {
                      $this->alpha = 255;
              
                      // a set of 3 colours
              Severity: Minor
              Found in lib/Weathermap/Core/Colour.php - About 55 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 readData has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function readData($targetString, &$map, &$mapItem)
                  {
                      $this->data[IN] = null;
                      $this->data[OUT] = null;
              
              
              Severity: Minor
              Found in lib/Weathermap/Plugins/Datasources/Time.php - About 55 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 doRetidyLinks has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function doRetidyLinks($ignoreTidied = false)
                  {
                      if (!$this->isLoaded()) {
                          throw new WeathermapInternalFail("Map must be loaded before editing API called.");
                      }
              Severity: Minor
              Found in lib/Weathermap/Editor/Editor.php - About 55 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 draw has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function draw($gdImage)
                  {
                      if (is_null($this->curvePoints)) {
                          throw new WeathermapInternalFail('DrawingEmptySpline');
                      }
              Severity: Minor
              Found in lib/Weathermap/Core/LinkGeometry.php - About 55 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 addNode has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function addNode($x, $y, $nodeName = "", $template = "DEFAULT")
                  {
                      if (!$this->isLoaded()) {
                          throw new WeathermapInternalFail("Map must be loaded before editing API called.");
                      }
              Severity: Minor
              Found in lib/Weathermap/Editor/Editor.php - About 55 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 readData has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function readData($targetString, &$map, &$mapItem)
                  {
                      $pdo = null;
                      $this->data[IN] = null;
                      $this->data[OUT] = null;
              Severity: Minor
              Found in lib/Weathermap/Plugins/Datasources/DatabaseSample.php - About 55 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 buildOverlibHTML has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  private function buildOverlibHTML($mapItem, $dir, $imageExtraHTML, $left, $above, $caption)
                  {
                      $overlibhtml = "onmouseover=\"return overlib('";
              
                      $n = 0;
              Severity: Minor
              Found in lib/Weathermap/Core/Map.php - About 55 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 getSimpleConfig has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function getSimpleConfig($simpleParameters, $reference)
                  {
                      $output = '';
                      foreach ($simpleParameters as $param) {
                          $field = $param[0];
              Severity: Minor
              Found in lib/Weathermap/Core/MapBase.php - About 55 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 getExistingConfigs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function getExistingConfigs($mapDirectory)
                  {
                      $titles = array();
                      $notes = array();
              
              
              Severity: Minor
              Found in lib/Weathermap/Editor/EditorUI.php - About 55 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 extractMapTitle has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function extractMapTitle($filename)
                  {
                      $title = "(no file)";
              
                      if (file_exists($filename)) {
              Severity: Minor
              Found in lib/Weathermap/Integrations/MapManager.php - About 55 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 outputGroupTabs has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
              Open

                  protected function outputGroupTabs($currentTab)
                  {
                      $tabs = $this->getValidTabs();
              
                      if (count($tabs) > 1) {
              Severity: Minor
              Found in lib/Weathermap/Integrations/Cacti/WeatherMapCactiUserPlugin.php - About 55 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