howardjones/network-weathermap

View on GitHub

Showing 463 of 1,093 total issues

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

    public function init(&$map)

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 33 to the 15 allowed.
Open

    public function readData($targetString, &$map, &$mapItem)

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 48 to the 15 allowed.
Open

    public function readData($targetString, &$map, &$mapItem)

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 "MapDataItem" has 23 methods, which is greater than 20 authorized. Split it into smaller classes.
Open

class MapDataItem extends MapItem

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 16 to the 15 allowed.
Open

    public static function testCronPart($value, $checkstring)
Severity: Critical
Found in lib/Weathermap/Core/Utility.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 61 to the 15 allowed.
Open

    public function readData($targetString, &$map, &$mapItem)

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 "MapManagerTest" has 30 methods, which is greater than 20 authorized. Split it into smaller classes.
Open

class MapManagerTest extends \PHPUnit_Extensions_Database_TestCase

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 17 to the 15 allowed.
Open

    public function testIndexOrphans()
Severity: Critical
Found in lib/Weathermap/Tests/DocsTest.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 "MapLink" has 24 methods, which is greater than 20 authorized. Split it into smaller classes.
Open

class MapLink extends MapDataItem
Severity: Major
Found in lib/Weathermap/Core/MapLink.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.

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

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

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 41 to the 15 allowed.
Open

    public function readData($targetString, &$map, &$mapItem)

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 19 to the 15 allowed.
Open

    protected function compareImages($src, $copy, $type)

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 29 to the 15 allowed.
Open

    private function drawLegendClassic($useTags = false)
Severity: Critical
Found in lib/Weathermap/Core/Legend.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

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

    private function findItemValue(&$mapItem, $variableName, $currentValue, $includeNotes = true)
Severity: Major
Found in lib/Weathermap/Core/Map.php by sonar-php

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;
}

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

    public function drawMap(
Severity: Critical
Found in lib/Weathermap/Core/Map.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 "Map" has 63 methods, which is greater than 20 authorized. Split it into smaller classes.
Open

class Map extends MapBase
Severity: Major
Found in lib/Weathermap/Core/Map.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.

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

class UIBase
Severity: Major
Found in lib/Weathermap/UI/UIBase.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 41 to the 15 allowed.
Open

    public function readData($targetString, &$map, &$mapItem)

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

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

    public function drawLegend()
Severity: Major
Found in lib/Weathermap/Core/Legend.php by sonar-php

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;
}

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

    public function validateRequest($action, $request)
Severity: Major
Found in lib/Weathermap/UI/UIBase.php by sonar-php

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;
}
Severity
Category
Status
Source
Language