Showing 463 of 1,093 total issues
Function calculateCommentPosition
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function calculateCommentPosition($fontObject, $comment, $direction, $widthList)
{
list($textWidth, $textHeight) = $fontObject->calculateImageStringSize($comment);
// nudge pushes the comment out along the link arrow a little bit
- 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 readConfigLines
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function readConfigLines($inputLines)
{
MapUtility::debug("in readConfigLines\n");
foreach ($inputLines as $buffer) {
- 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 init
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function init(&$link, $controlPoints, $widths, $directions = 2, $splitPosition = 50, $arrowStyle = 'classic')
Method tidySimpleDimension
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
private function tidySimpleDimension($boundingBoxA, $boundingBoxB, $nodeA, $nodeB, $simpleIndex, $simpleCoordinate)
Function getBySubstring
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function getBySubstring($nameFilter, $reverseOrder = false)
{
$result = array();
foreach ($this->shapes as $shape) {
- 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 drawImageString
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function drawImageString($gdImage, $x, $y, $string, $colour, $angle = 0)
Method drawImageString
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function drawImageString($gdImage, $x, $y, $string, $colour, $angle = 0)
Function readConfigSimpleAssignment
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
private function readConfigSimpleAssignment($keyword, $matches)
{
foreach ($keyword[1] as $key => $val) {
// so we can poke in numbers too, if the value starts with #
// then take the # off, and treat the rest as a number literal
- 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 updateMapProperties
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function updateMapProperties($params)
{
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
Function extractSettingsCookie
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function extractSettingsCookie($cookies)
{
// these are all set via the Editor Settings dialog, in the editor, now.
$this->useOverlayVIA = false; // set to TRUE to enable experimental overlay showing VIAs
- 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 handleNodeStep1
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function handleNodeStep1($request, $context = null)
{
global $config; // Cacti config object
$hostId = -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
Avoid deeply nested control flow statements. Open
if ($size[0] > $this->minBGImageSize && $size[1] > $this->minBGImageSize) {
$bg = true;
}
Function mapReadOnlySettings
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function mapReadOnlySettings(
$id,
$title = ''
) {
if ($title == '') {
- 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 8 (exceeds 5 allowed). Consider refactoring. Open
function weathermap_show_tab()
{
global $config, $user_auth_realm_filenames;
$realmID = 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
Method buildOverlibPositioning
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function buildOverlibPositioning($mapItem, $midX, $mapCenterX, $midY, $mapCenterY)
Method drawMarkerPolygon
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public static function drawMarkerPolygon($gdImage, $colour, $point, $size, $relativeMoves)
Method imagecreatescaledcolourizedfromfile
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function imagecreatescaledcolourizedfromfile($filename, $scaleWidth, $scaleHeight, $colour, $colourMethod)
Method drawLabel
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
private function drawLabel(&$map, $textPoint, $backgroundColour, $nodeImageRef, $labelBox)
Method addSpan
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function addSpan($lowValue, $highValue, $lowColour, $highColour = null, $tag = '')
Function writeImageFile
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
protected function writeImageFile($imageFileName, $imageRef)
{
$extension = strtolower(substr($imageFileName, -4, 4));
$types = 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"