Showing 380 of 1,093 total issues
Function handleGroupSelect
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
public function handleGroupSelect(
$request,
$appObject
) {
$this->cactiHeader();
- 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 __construct
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($name, $template, $owner)
{
parent::__construct();
$this->name = $name;
Method calculateImagemap
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function calculateImagemap()
{
MapUtility::debug("Trace: calculateImagemap()\n");
// loop through everything. Figure out along the way if it's a node or a link
Method ping
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function ping(&$item, $targetAddress, $pingCount)
{
if (!is_executable($this->fpingCommand)) {
MapUtility::warn("FPing ReadData: Can't find fping executable. Check path at line 36 of FPing");
return;
Method debug
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function debug($string)
{
global $weathermap_debugging;
global $weathermap_map;
global $weathermap_debug_suppress;
Method preCalculate
has 48 lines of code (exceeds 25 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
Method drawMap
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function drawMap(
$imageFileName = '',
$thumbnailFileName = '',
$thumbnailMaxSize = 250,
$includeNodes = true,
Method maplistWarnings
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
protected function maplistWarnings()
{
if (!MapUtility::moduleChecks()) {
print '<div align="center" class="wm_warning"><p>';
Function selfValidate
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function selfValidate()
{
$result = true;
foreach ($this->types as $type => $validator) {
- 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 debug
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public static function debug($string)
{
global $weathermap_debugging;
global $weathermap_map;
global $weathermap_debug_suppress;
- 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 readData
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
public function readData($targetString, &$map, &$mapItem)
{
$this->data[IN] = null;
$this->data[OUT] = 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 resolveRelativePositions
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function resolveRelativePositions()
{
// calculate any relative positions here - that way, nothing else
// really needs to know about them
- 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 testVector
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function testVector()
{
$infiniteSlope = 10000000000.0;
$vector1 = new Vector(0, 0);
Method init
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init(&$map)
{
if ($map->context == 'cacti') {
$pdo = weathermap_get_pdo();
Function show_link
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
function show_link(name) {
mapmode('existing');
hide_all_dialogs();
Method init
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function init(&$map)
{
if ($map->context == 'cacti') {
if (!function_exists('db_fetch_assoc')) {
MapUtility::debug("ReadData DSStats: Cacti database library not found. [DSSTATS001]\n");
Function testKeywordCoverage
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
public function testKeywordCoverage()
{
$docsIndex = $this->docsRoot . "/index.xml";
- 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 checkPaths
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function checkPaths()
{
$version = explode('.', PHP_VERSION);
self::$phpTag = "php-" . $version[0] . "." . $version[1];
Method asConfig
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function asConfig($scaleName, $kilo, $decimalPoint)
{
$output = "";
$top = rtrim(
Method main
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function main($request, $cookies, $fromPlugin = false)
{
$mapFileName = "";
$action = "";