Showing 380 of 1,093 total issues
Method readData
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readData($targetString, &$map, &$mapItem)
{
$this->data[IN] = null;
$this->data[OUT] = null;
$this->dataTime = time();
Function getConfig
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function getConfig()
{
$output = '';
$output .= "# Automatically generated by php-weathermap v" . WEATHERMAP_VERSION . "\n\n";
- Read upRead up
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 generateSortedImagemap
has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring. Open
public function generateSortedImagemap($imagemapname)
{
$html = "\n<map name=\"" . $imagemapname . '" id="' . $imagemapname . "\">\n";
$allLayers = array_keys($this->seenZLayers);
- Read upRead up
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
WeatherMapCactiUserPlugin
has 35 functions (exceeds 20 allowed). Consider refactoring. Open
class WeatherMapCactiUserPlugin extends UIBase
{
/** @var MapManager $manager */
public $manager;
public $myURL;
MapNode
has 34 functions (exceeds 20 allowed). Consider refactoring. Open
class MapNode extends MapDataItem
{
public $drawable;
// Coordinates we're actually going to draw at
Method getConfig
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfig()
{
if ($this->configOverride != '') {
return $this->configOverride . "\n";
}
File MapDataItem.php
has 341 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Weathermap\Core;
/**
File check.php
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
$criticalCount = 0;
$nonCriticalCount = 0;
// This constant was added in PHP 5.2 - since we're actually checking that the version is > 5.3, it might
Method readData
has 103 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readData($targetString, &$map, &$mapItem)
{
$this->data[IN] = null;
$this->data[OUT] = null;
$pdo = weathermap_get_pdo();
Function drawLegendClassic
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
private function drawLegendClassic($useTags = false)
{
$nScales = $this->scale->spanCount();
MapUtility::debug("Drawing $nScales colours into SCALE\n");
- Read upRead up
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 init
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function init(&$map)
{
if ($map->context == 'cacti') {
if (!function_exists('db_fetch_assoc')) {
MapUtility::debug("ReadData DSStats: Cacti database library not found. [DSSTATS001]\n");
- Read upRead up
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
Method weathermap_poller_output
has 101 lines of code (exceeds 25 allowed). Consider refactoring. Open
function weathermap_poller_output($rrdUpdateArray)
{
global $config;
$pdo = weathermap_get_pdo();
Method weathermap_config_settings
has 100 lines of code (exceeds 25 allowed). Consider refactoring. Open
function weathermap_config_settings()
{
global $tabs, $settings;
$tabs['weathermap'] = __('Maps', 'weathermap');
Method addmapPicker
has 98 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function addmapPicker(
$showAllFiles = false
) {
$loaded = array();
$flags = array();
Function runMaps
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
function runMaps($mydir)
{
global $weathermap_debugging;
global $weathermapPollerStartTime;
- Read upRead up
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
Method readData
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readData($targetString, &$map, &$mapItem)
{
$this->data[IN] = null;
$this->data[OUT] = null;
$dsnames = array(IN => "traffic_in", OUT => "traffic_out");
Method drawLegendClassic
has 95 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function drawLegendClassic($useTags = false)
{
$nScales = $this->scale->spanCount();
MapUtility::debug("Drawing $nScales colours into SCALE\n");
Function imagecreatefromfile
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function imagecreatefromfile($filename)
{
$resultImage = null;
$newImage = null;
- Read upRead up
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
Method getConfig
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function getConfig()
{
$output = '';
$output .= "# Automatically generated by php-weathermap v" . WEATHERMAP_VERSION . "\n\n";
MapManagerTest
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class MapManagerTest extends \PHPUnit_Extensions_Database_TestCase
{
// only instantiate pdo once for test clean-up/fixture load
static private $pdo = null;