Showing 380 of 1,093 total issues
Function drawLabel
has a Cognitive Complexity of 10 (exceeds 5 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
- 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 readConfigLine
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function readConfigLine($args, $buffer)
{
$matches = null;
if (!isset($args[0])) {
- 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 checkPaths
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function checkPaths()
{
$version = explode('.', PHP_VERSION);
self::$phpTag = "php-" . $version[0] . "." . $version[1];
- 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 simplifyOffset
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public static function simplifyOffset($xOffset, $yOffset)
{
if ($xOffset == 0 && $yOffset == 0) {
return "";
}
- 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 preCalculate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function preCalculate(&$map)
{
MapUtility::debug('Link ' . $this->name . ": Calculating geometry.\n");
// don't bother doing anything if it's a template
- 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 run
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function run()
{
if (!$this->preChecks()) {
return false;
}
- 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 processStringFindReferredObject
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
private function processStringFindReferredObject(&$context, $itemname, $type)
{
if (($itemname == "this") && ($type == strtolower($context->myType()))) {
return $context;
}
- 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_page_title
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function weathermap_page_title($t)
{
if (preg_match('/plugins\/weathermap\//', $_SERVER['REQUEST_URI'], $matches)) {
$t .= " - Weathermap";
- 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 handleDefaultView
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function handleDefaultView($request, $appObject)
{
global $wm_showOldUI, $config;
$weathermapPath = $config['url_path'] . 'plugins/weathermap/';
- 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_page_title
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function weathermap_page_title($t)
{
if (preg_match('/plugins\/weathermap\//', $_SERVER['REQUEST_URI'], $matches)) {
$t .= " - Weathermap";
- 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 get_cidr
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function get_cidr($mask)
{
$lookup = array(
"255.255.255.255" => "32",
"255.255.255.254" => "31",
Method warn
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function warn($string, $noticeOnly = false)
{
global $weathermap_map;
global $weathermap_warncount;
global $weathermap_error_suppress;
Function render
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
render() {
return <div className='wm-create-map-container wm-popup'>
<h3>Create a new map</h3>
<p>Map name: <input type="text"/></p>
<p>source map: <Selector id="sourceselector"
Method selfValidate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function selfValidate()
{
$result = true;
foreach ($this->types as $type => $validator) {
Method prepareForDataCollection
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function prepareForDataCollection()
{
/** @var Target $target */
foreach ($this->targets as $target) {
MapUtility::debug("ProcessTargets: New Target: $target\n");
Method dumpKeywords
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function dumpKeywords()
{
$count = 0;
print "# Complete configuration keyword list\n\n";
foreach ($this->configKeywords as $scope => $keywords) {
Method findIndexNearDistance
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function findIndexNearDistance($targetDistance)
{
$left = 0;
$right = count($this->elements) - 1;
Method calculateAICONColours
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function calculateAICONColours($labelColour, &$map)
{
$finalFillColour = new Colour('none');
$finalInkColour = new Colour('none');
Method init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init(&$map)
{
global $config;
if ($map->context == 'cacti') {
Method formatTimeTicks
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function formatTimeTicks($value, $prefix, $tokenCharacter, $precision)
{
$joinCharacter = ' ';
if ($prefix == '-') {
$joinCharacter = '';