Showing 380 of 1,093 total issues
Function replicateLegendSettings
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function replicateLegendSettings()
{
foreach ($this->legends as $scaleName => $legendObject) {
// These are currently global settings for a map, not per-scale
$legendObject->keyoutlinecolour = $this->colourtable['KEYOUTLINE'];
- 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 drawTimestamp
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function drawTimestamp($imageRef, $font, $colour, $which = '')
{
// add a timestamp to the corner, so we can tell if it's all being updated
$fontObject = $this->fonts->getFont($font);
- 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 getPluginFileList
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function getPluginFileList($pluginType, $searchDirectory)
{
$pluginList = array();
$directoryHandle = $this->resolveDirectoryAndOpen($searchDirectory);
- 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 aggregateDataResults
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function aggregateDataResults()
{
$channels = $this->getChannelList();
foreach ($channels as $channelName => $channel) {
- 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 make_target_string
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function make_target_string($local_data_id, $dsnames, $multiply, $multiplier)
{
$new_target = sprintf("dsstats:%d:%s:%s", $local_data_id, $dsnames[IN], $dsnames[OUT]);
$m = $multiply * $multiplier;
- 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 getNodeFromID
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function getNodeFromID(id) {
for (var nodename in mapdata.Nodes) {
if (mapdata.Nodes.hasOwnProperty(nodename)) {
var node = mapdata.Nodes[nodename];
if (node.id === id) {
- 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 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
- 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 handleSET
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function handleSET($fullcommand, $args, $matches)
{
global $weathermap_error_suppress;
$key = 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
Function drawComments
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function drawComments($gdImage)
{
MapUtility::debug('Link ' . $this->name . ": Drawing comments.\n");
$directions = $this->getDirectionList();
- 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 handleNODE
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function handleNODE($fullcommand, $args, $matches)
{
$this->commitItem();
unset($this->currentObject);
- 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 formatTimeTicks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function formatTimeTicks($value, $prefix, $tokenCharacter, $precision)
{
$joinCharacter = ' ';
if ($prefix == '-') {
$joinCharacter = '';
- 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 processStringToken
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function processStringToken($includeNotes, $keyContents, $key, $context)
{
$value = '[UNKNOWN]';
$format = "";
$theItem = 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
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
- 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 sprintf
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function sprintf($format, $value, $kilo = 1000)
{
// if we get a null, it probably means no-data from the datasource plugin
// don't coerce that into a zero
if ($value === 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
Function imagecreatescaledfromfile
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function imagecreatescaledfromfile($filename, $scaleWidth, $scaleHeight)
{
list($width, $height) = getimagesize($filename);
MapUtility::debug("Getting a (maybe cached) image for $filename at $scaleWidth x $scaleHeight\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 handleNODE_USESCALE
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function handleNODE_USESCALE($fullcommand, $args, $matches)
{
$svar = '';
$stype = 'percent';
// in or out?
- 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 cmdDrawMap
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function cmdDrawMap($params, $editor)
{
header("Content-type: image/png");
// If the config file hasn't changed, then the image produced shouldn't have, either
$etag = md5_file($this->mapFileName);
- 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 resortMaps
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function resortMaps()
{
$stmt = $this->pdo->query('SELECT * FROM weathermap_maps ORDER BY group_id,sortorder;');
$newMapOrder = 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
Function showMainPage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function showMainPage($editor)
{
global $hostPluginURL;
global $hostEditorURL;
global $hostType;
- 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 weathermap_show_tab
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function weathermap_show_tab()
{
global $config, $user_auth_realm_filenames;
if (api_plugin_user_realm_auth('weathermap-cacti10-plugin.php')) {
- 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"