howardjones/network-weathermap

View on GitHub
lib/Weathermap/Core/MapBase.php

Summary

Maintainability
A
2 hrs
Test Coverage

Showing 5 of 5 total issues

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

Function getConfigValue has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

public function getConfigValue($keyname)
{
if (isset($this->config[$keyname])) {
return array($this->config[$keyname], self::CONF_FOUND_DIRECT);
}
Severity: Minor
Found in lib/Weathermap/Core/MapBase.php - About 35 mins to fix

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

public function getHintConfig($comparison)
{
$output = '';
foreach ($this->hints as $hintName => $hint) {
// all hints for DEFAULT node are for writing
Severity: Minor
Found in lib/Weathermap/Core/MapBase.php - About 25 mins to fix

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

public function addConfigValue($keyname, $value, $recalculate = false)
{
MapUtility::debug("Appending config %s = %s\n", $keyname, $value);
if (is_null($this->config[$keyname])) {
// create a new array, with this as the only item
Severity: Minor
Found in lib/Weathermap/Core/MapBase.php - About 25 mins to fix

Remove the code after this "throw".
Open

throw new WeathermapUnimplementedException('Dynamic dependencies not implemented yet');
Severity: Major
Found in lib/Weathermap/Core/MapBase.php by sonar-php

There are no issues that match your filters.

Category
Status