Showing 380 of 1,093 total issues
Method readFromPollerOutput
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function readFromPollerOutput($rrdfile, $cf, $start, $end, $dsnames, &$map, &$item)
{
global $config;
$pdo = weathermap_get_pdo();
Method showMainPage
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function showMainPage($editor)
{
global $hostPluginURL;
global $hostEditorURL;
global $hostType;
Function generateOutlines
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
protected function generateOutlines()
{
MapUtility::debug("Calculating angled-style outline\n");
foreach ($this->directions as $direction) {
- 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 initializeDatabase
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function initializeDatabase()
{
// only bother with all this if it's a new install, a new version, or we're in a development version
// - saves a handful of db hits per request!
- 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 main
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function main($request, $cookies, $fromPlugin = false)
{
$mapFileName = "";
$action = "";
- 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 drawLegendVertical
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function drawLegendVertical($keyHeight = 400, $inverted = false)
{
$title = $this->keytitle;
$nScales = $this->scale->spanCount();
File Runner.php
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Weathermap\CLI;
use GetOpt\GetOpt;
Method drawLabel
has 70 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function drawLabel(&$map, $textPoint, $backgroundColour, $nodeImageRef, $labelBox)
{
MapUtility::debug("Label colour is $backgroundColour\n");
// if there's an icon, then you can choose to have no background
Function handleInheritance
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
private function handleInheritance($inheritables, $params)
{
$defaultLink = $this->map->getLink("DEFAULT");
$defaultNode = $this->map->getNode("DEFAULT");
- 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 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readData($targetString, &$map, &$mapItem)
{
$this->data[IN] = null;
$this->data[OUT] = null;
Method readData
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function readData($targetString, &$map, &$mapItem)
{
$this->data[IN] = null;
$this->data[OUT] = null;
MapLink
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
class MapLink extends MapDataItem
{
const FMT_BITS_IN = '{link:this:bandwidth_in:%2k}';
const FMT_BITS_OUT = '{link:this:bandwidth_out:%2k}';
const FMT_UNFORM_IN = '{link:this:bandwidth_in}';
File cacti-mapper.php
has 275 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
# defaults. Should be overwritten by the cacti config.
$cacti_base = '../../';
$cacti_url = '/';
Method __construct
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct()
{
parent::__construct();
$this->inheritedFieldList = array
Method createMissingTables
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function createMissingTables($tables)
{
$databaseUpdates = array();
if (!in_array('weathermap_maps', $tables)) {
Method tidyOneLink
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function tidyOneLink($link, $linknumber = 1, $linktotal = 1)
{
if ($link->isTemplate()) {
return;
}
Method __construct
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($name, $template, $owner)
{
parent::__construct();
$this->name = $name;
Method testParameterValidation
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testParameterValidation()
{
$ui = new EditorUI();
$this->assertFalse($ui->validateArgument("", 10), "Blank type is always false");
MapDataItem
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class MapDataItem extends MapItem
{
// arrays to replace a lot of what follows. Paving the way for >2 channels of data.
// (and generally less duplicated code)
public $maxValues = array();
UIBase
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
class UIBase
{
const ARG_OPTIONAL = 2;
const ARG_TYPE = 1;
const ARG_NAME = 0;