Showing 380 of 1,093 total issues
ConfigReader
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class ConfigReader
{
private $lineCount = 0;
/** @var MapDataItem $currentObject */
private $currentObject = null;
Function parseString
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
public function parseString($input)
{
$output = array(); // Array of Output
$cPhraseQuote = null; // Record of the quote that opened the current phrase
$sPhrase = null; // Temp storage for the current phrase we are building
- 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 readFromRealRRDtoolWithAggregate
has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring. Open
private function readFromRealRRDtoolWithAggregate(
$rrdfile,
$cf,
$aggregatefn,
$start,
- 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 runMaps
has 89 lines of code (exceeds 25 allowed). Consider refactoring. Open
function runMaps($mydir)
{
global $weathermap_debugging;
global $weathermapPollerStartTime;
Method run
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function run()
{
if (!$this->preChecks()) {
return false;
}
Method moveNode
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function moveNode($nodeName, $newX, $newY)
{
if (!$this->isLoaded()) {
throw new WeathermapInternalFail("Map must be loaded before editing API called.");
}
Method weathermap_config_settings
has 87 lines of code (exceeds 25 allowed). Consider refactoring. Open
function weathermap_config_settings()
{
global $tabs, $settings;
$tabs["misc"] = "Misc";
Method readFromRealRRDtool
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function readFromRealRRDtool($rrdfile, $cf, $start, $end, $dsnames, &$map, &$item)
{
MapUtility::debug("RRD ReadData: traditional style\n");
// we get the last 800 seconds of data - this might be 1 or 2 lines, depending on when in the
Function init
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
public function init(&$map)
{
if ($map->context == 'cacti') {
$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
File cacti-integrate.php
has 306 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/** cacti-integrate.php
*
* Auto-fill a basic map file with as much information as possible from the
* Cacti database, using interface names and node ip/names as clues.
Method generateOutlines
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function generateOutlines()
{
MapUtility::debug("Calculating angled-style outline\n");
foreach ($this->directions as $direction) {
Method drawArtificialIconNINK
has 82 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function drawArtificialIconNINK($iconImageRef, $finalInkColour, &$map)
{
$xRadius = $this->iconscalew / 2 - 1;
$yRadius = $this->iconscaleh / 2 - 1;
$size = $this->iconscalew;
Function drawMap
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
public function drawMap(
$imageFileName = '',
$thumbnailFileName = '',
$thumbnailMaxSize = 250,
$includeNodes = true,
- 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 drawLegendHorizontal
has 81 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function drawLegendHorizontal($keyWidth = 400)
{
$title = $this->keytitle;
Function renameNode
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function renameNode($oldName, $newName)
{
if (!$this->map->nodeExists($oldName)) {
return $oldName;
}
- 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 dumpKeywords
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function dumpKeywords()
{
$count = 0;
print "# Complete configuration keyword list\n\n";
foreach ($this->configKeywords as $scope => $keywords) {
- 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 getAvailableImages
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
public function getAvailableImages($imageDirectory, $map)
{
$imageList = array();
if (is_dir($imageDirectory)) {
- 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 UIBase.php
has 295 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
namespace Weathermap\UI;
use Weathermap\Core\WeathermapInternalFail;
Method mapSettings
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function mapSettings(
$id
) {
if ($id == 0) {
$title = __('Additional settings for ALL maps');
Method readFromRealRRDtoolWithAggregate
has 76 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function readFromRealRRDtoolWithAggregate(
$rrdfile,
$cf,
$aggregatefn,
$start,