howardjones/network-weathermap

View on GitHub

Showing 463 of 1,093 total issues

Refactor this function to reduce its Cognitive Complexity from 36 to the 15 allowed.
Open

    public function getConfig()
Severity: Critical
Found in lib/Weathermap/Core/MapNode.php by sonar-php

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 46 to the 15 allowed.
Open

    public function parseString($input)
Severity: Critical
Found in lib/Weathermap/Core/ConfigReader.php by sonar-php

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 27 to the 15 allowed.
Open

function runMaps($mydir)

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 52 to the 15 allowed.
Open

    public function moveNode($nodeName, $newX, $newY)
Severity: Critical
Found in lib/Weathermap/Editor/Editor.php by sonar-php

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 20 to the 15 allowed.
Open

    private function handleInheritance($inheritables, $params)
Severity: Critical
Found in lib/Weathermap/Editor/Editor.php by sonar-php

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Class "MapNode" has 34 methods, which is greater than 20 authorized. Split it into smaller classes.
Open

class MapNode extends MapDataItem
Severity: Major
Found in lib/Weathermap/Core/MapNode.php by sonar-php

A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.

Reduce the number of returns of this function 4, down to the maximum allowed 3.
Open

    public static function moduleChecks()

Having too many return statements in a function increases the function's essential complexity because the flow of execution is broken each time a return statement is encountered. This makes it harder to read and understand the logic of the function.

Noncompliant Code Example

With the default threshold of 3:

function myFunction(){ // Noncompliant as there are 4 return statements
  if (condition1) {
    return true;
  } else {
    if (condition2) {
      return false;
    } else {
      return true;
    }
  }
  return false;
}

Class "Editor" has 43 methods, which is greater than 20 authorized. Split it into smaller classes.
Open

class Editor
Severity: Major
Found in lib/Weathermap/Editor/Editor.php by sonar-php

A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.

Refactor this function to reduce its Cognitive Complexity from 32 to the 15 allowed.
Open

    protected function maplist()

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Class "EditorUI" has 52 methods, which is greater than 20 authorized. Split it into smaller classes.
Open

class EditorUI extends UIBase

A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.

This function "maplist" has 209 lines, which is greater than the 150 lines authorized. Split it into smaller functions.
Open

    protected function maplist()

A function that grows too large tends to aggregate too many responsibilities.

Such functions inevitably become harder to understand and therefore harder to maintain.

Above a specific threshold, it is strongly advised to refactor into smaller functions which focus on well-defined tasks.

Those smaller functions will not only be easier to understand, but also probably easier to test.

Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
Open

    private function getMapFileList()

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 55 to the 15 allowed.
Open

    protected function addmapPicker(

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 44 to the 15 allowed.
Open

function weathermap_poller_output($rrdUpdateArray)

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 23 to the 15 allowed.
Open

    public function getAvailableImages($imageDirectory, $map)
Severity: Critical
Found in lib/Weathermap/Editor/EditorUI.php by sonar-php

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 16 to the 15 allowed.
Open

    public function handleGroupSelect(

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

This function "weathermap_draw_navigation_text" has 234 lines, which is greater than the 150 lines authorized. Split it into smaller functions.
Open

function weathermap_draw_navigation_text($nav)

A function that grows too large tends to aggregate too many responsibilities.

Such functions inevitably become harder to understand and therefore harder to maintain.

Above a specific threshold, it is strongly advised to refactor into smaller functions which focus on well-defined tasks.

Those smaller functions will not only be easier to understand, but also probably easier to test.

This function "weathermap_draw_navigation_text" has 235 lines, which is greater than the 150 lines authorized. Split it into smaller functions.
Open

function weathermap_draw_navigation_text($nav)

A function that grows too large tends to aggregate too many responsibilities.

Such functions inevitably become harder to understand and therefore harder to maintain.

Above a specific threshold, it is strongly advised to refactor into smaller functions which focus on well-defined tasks.

Those smaller functions will not only be easier to understand, but also probably easier to test.

Refactor this function to reduce its Cognitive Complexity from 21 to the 15 allowed.
Open

    public function initializeDatabase()

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Refactor this function to reduce its Cognitive Complexity from 21 to the 15 allowed.
Open

    public function main($request, $cookies, $fromPlugin = false)
Severity: Critical
Found in lib/Weathermap/Editor/EditorUI.php by sonar-php

Cognitive Complexity is a measure of how hard the control flow of a function is to understand. Functions with high Cognitive Complexity will be difficult to maintain.

See

Severity
Category
Status
Source
Language