Showing 380 of 1,093 total issues
File Map.php
has 1266 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Weathermap\Core;
// PHP Weathermap 0.98
File WeatherMapCactiManagementPlugin.php
has 1237 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Weathermap\Integrations\Cacti;
require_once dirname(__FILE__) . "/database.php";
File MapNode.php
has 972 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
// PHP Weathermap 0.98
// Copyright Howard Jones, 2005-2016 howie@thingy.com
// http://www.network-weathermap.com/
// PHP Weathermap is licensed under the MIT License, see LICENSE file for more information.
File EditorUI.php
has 910 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
// PHP Weathermap 0.97b
// Copyright Howard Jones, 2005-2012 howie@thingy.com
// http://www.network-weathermap.com/
// PHP Weathermap is licensed under the MIT License, see LICENSE file for more information.
File Editor.php
has 813 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
// PHP Weathermap 0.97b
// Copyright Howard Jones, 2005-2012 howie@thingy.com
// http://www.network-weathermap.com/
// PHP Weathermap is licensed under the MIT License, see LICENSE file for more information.
File MapManager.php
has 675 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Weathermap\Integrations;
use PDO;
File MapLink.php
has 643 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
// PHP Weathermap 0.98
// Copyright Howard Jones, 2005-2016 howie@thingy.com
// http://www.network-weathermap.com/
// PHP Weathermap is licensed under the MIT License, see LICENSE file for more information.
Function readData
has a Cognitive Complexity of 61 (exceeds 5 allowed). Consider refactoring. Open
public function readData($targetString, &$map, &$mapItem)
{
$this->data[IN] = null;
$this->data[OUT] = null;
$this->dataTime = time();
- 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
Map
has 63 functions (exceeds 20 allowed). Consider refactoring. Open
class Map extends MapBase
{
/** @var MapNode[] $nodes */
public $nodes = array();
/** @var MapLink[] $links */
Method weathermap_draw_navigation_text
has 223 lines of code (exceeds 25 allowed). Consider refactoring. Open
function weathermap_draw_navigation_text($nav)
{
$nav["weathermap-cacti88-plugin.php:"] = array(
"title" => "Weathermap",
"mapping" => "index.php:",
Function addmapPicker
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
protected function addmapPicker(
$showAllFiles = false
) {
$loaded = array();
$flags = array();
- 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
File WeatherMapCactiUserPlugin.php
has 497 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Weathermap\Integrations\Cacti;
require_once dirname(__FILE__) . "/database.php";
MapManager
has 54 functions (exceeds 20 allowed). Consider refactoring. Open
class MapManager
{
/** @var PDO $pdo */
private $pdo;
File editor.js
has 481 lines of code (exceeds 250 allowed). Consider refactoring. Open
// global variable for subwindow reference
var newWindow;
// seed the help text. Done in a big lump here, so we could make a foreign language version someday.
Function readData
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
public function readData($targetString, &$map, &$mapItem)
{
$this->data[IN] = null;
$this->data[OUT] = null;
$pdo = weathermap_get_pdo();
- 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 getConfig
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
public function getConfig()
{
if ($this->configOverride != '') {
return $this->configOverride . "\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
EditorUI
has 52 functions (exceeds 20 allowed). Consider refactoring. Open
class EditorUI extends UIBase
{
private $editor;
private $selected = "";
Function readFromPollerOutput
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
private function readFromPollerOutput($rrdfile, $cf, $start, $end, $dsnames, &$map, &$item)
{
global $config;
$pdo = weathermap_get_pdo();
- 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 moveNode
has a Cognitive Complexity of 47 (exceeds 5 allowed). Consider refactoring. Open
public function moveNode($nodeName, $newX, $newY)
{
if (!$this->isLoaded()) {
throw new WeathermapInternalFail("Map must be loaded before editing API called.");
}
- 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 maplist
has 176 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function maplist()
{
\html_start_box(
__('Weathermaps'),
'100%',