Showing 706 of 6,805 total issues
Function GetMaxActInfoColWidth
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function GetMaxActInfoColWidth()
{
$n = safe_count($this->iObj);
if ($n == 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 _strokeBackgroundImage
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function _strokeBackgroundImage()
{
if ($this->background_image == '') {
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
Avoid deeply nested control flow statements. Open
switch ($this->iObj[$i]->constraints[$k]->iConstrainType) {
case CONSTRAIN_ENDSTART:
if ($c1[1] < $c2[1]) {
$link = new Image\GanttLink($c1[2], $c1[3], $c2[0], $c2[1]);
} else {
Avoid deeply nested control flow statements. Open
if (!(($i == $n || $i == 0) && $this->hour->iShowLabels && $this->hour->grid->iShow)) {
$img->SetColor($this->minute->grid->iColor);
$img->SetLineWeight($this->minute->grid->iWeight);
$img->Line($x, $yt, $x, $yb);
$this->minute->grid->Stroke($img, $x, $yb, $x, $img->height - $img->bottom_margin);
Avoid deeply nested control flow statements. Open
switch ($this->minute->iStyle) {
case MINUTESTYLE_CUSTOM:
$txt = date($this->minute->iLabelFormStr, $datestamp);
break;
Function StrokeTexts
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function StrokeTexts()
{
// Stroke any user added text objects
if ($this->texts != null) {
$n = safe_count($this->texts);
- 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 GetBarMinMax
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function GetBarMinMax()
{
$start = 0;
$n = safe_count($this->iObj);
while ($start < $n && $this->iObj[$start]->GetMaxDate() === 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
Avoid deeply nested control flow statements. Open
if ($this->iObj[$j]->iVPos == $vpos) {
$targetobj = $j;
}
Avoid deeply nested control flow statements. Open
if ($day == 6 || $day == 0) {
$img->PushColor($this->day->iWeekendBackgroundColor);
if ($this->iUsePlotWeekendBackground) {
$img->FilledRectangle($x, $yt + $this->day->iFrameWeight, $x + $width, $img->height - $img->bottom_margin);
} else {
Consider simplifying this complex logical expression. Open
if ($this->grad && $this->legend != '' && !$this->fill) {
$color = [$this->grad_fromcolor, $this->grad_tocolor];
// In order to differentiate between gradients and cooors specified as an Image\RGB triple
$graph->legend->Add(
$this->legend,
Consider simplifying this complex logical expression. Open
if (($aColor[0] >= 0 && $aColor[0] <= 255) &&
($aColor[1] >= 0 && $aColor[1] <= 255) &&
($aColor[2] >= 0 && $aColor[2] <= 255)) {
return sprintf('#%02x%02x%02x', $aColor[0], $aColor[1], $aColor[2]);
}
Consider simplifying this complex logical expression. Open
if ($aFormat == 'jpeg' && !($supported & IMG_JPG)) {
$tst = false;
} elseif ($aFormat == 'png' && !($supported & IMG_PNG)) {
$tst = false;
} elseif ($aFormat == 'gif' && !($supported & IMG_GIF)) {
Consider simplifying this complex logical expression. Open
if (($aColor[0] >= 0 && $aColor[0] <= 255) &&
($aColor[1] >= 0 && $aColor[1] <= 255) &&
($aColor[2] >= 0 && $aColor[2] <= 255)) {
return sprintf('#%02x%02x%02x', $aColor[0], $aColor[1], $aColor[2]);
}
Consider simplifying this complex logical expression. Open
if (($this->supress_zerolabel && $l == 0) || ($this->supress_first && $aIdx == 0) || ($this->supress_last && $aIdx == $aNbrTicks - 1)) {
$l = '';
}
Method SetConstrain
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function SetConstrain($aRow, $aType, $aColor = 'black', $aArrowSize = ARROW_S2, $aArrowType = ARROWT_SOLID)
Method _StrokeLegend
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function _StrokeLegend($aImg, $x, $y, $scaling = 1, $aReturnWidth = false)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($aFile = '', $aX = 0, $aY = 0, $aScale = 1.0, $aMix = 100)
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($aDataMatrix, $aIsobar = 10, $aFactor = 1, $aInvert = false, $aIsobarColors = [])
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($aDate, $aTitle = '', $aColor = 'darkred', $aWeight = 2, $aStyle = 'solid')
Method AddArea
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function AddArea($aMin = 0, $aMax = 0, $aFilled = LP_AREA_NOT_FILLED, $aColor = 'gray9', $aBorder = LP_AREA_BORDER)