Showing 706 of 6,805 total issues
Function Stroke
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function Stroke($aImg, $ax = -1, $ay = -1)
{
// To position the super script correctly we need different
// cases to handle the alignmewnt specified since that will
// determine how we can interpret the x,y coordinates
- 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 Stroke
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function Stroke($aImg, $aX, $aY, $aWidth, $aHeight)
{
// If this is a merged cell we only stroke if it is the parent cell.
// The parent cell holds the merged cell block
if ($this->iMerged && ($this->iRow != $this->iPRow || $this->iCol != $this->iPCol)) {
- 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 AutoScale
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
public function AutoScale($img, $aStartTime, $aEndTime, $aNumSteps, $_adummy = false)
{
// We need to have one dummy argument to make the signature of AutoScale()
// identical to LinearScale::AutoScale
if ($aStartTime == $aEndTime) {
- 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
File FlagImages.php
has 342 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* JPGraph v4.0.3
*/
Method StrokeLabels
has 105 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function StrokeLabels($aPos, $aMinor = false, $aAbsLabel = false)
{
if (is_array($this->label_color) && safe_count($this->label_color) > 3) {
$this->ticks_label_colors = $this->label_color;
$this->img->SetColor($this->label_color[0]);
Function doYearly
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public static function doYearly($aType, $aMinor = false)
{
$i = 0;
$j = 0;
$m = self::$startmonth;
- 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 AutoScale
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function AutoScale($img, $min, $max, $maxsteps, $majend = true)
{
if (!is_numeric($min) || !is_numeric($max)) {
Util\JpGraphError::Raise(25044);
}
- 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 CreateSimple
has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring. Open
public function CreateSimple($data, $constrains = [], $progress = [])
{
$num = safe_count($data);
for ($i = 0; $i < $num; ++$i) {
switch ($data[$i][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
LineTest
has 32 functions (exceeds 20 allowed). Consider refactoring. Open
class LineTest extends \Codeception\Test\Unit
{
use Amenadiel\JpGraph\UnitTest\UnitTestTrait;
public static $fixTures = [];
Method Stroke
has 99 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Stroke($aImg, $aX, $aY, $aWidth, $aHeight)
{
// If this is a merged cell we only stroke if it is the parent cell.
// The parent cell holds the merged cell block
if ($this->iMerged && ($this->iRow != $this->iPRow || $this->iCol != $this->iPCol)) {
Method Stroke
has 97 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Stroke($aStrokeFileName = '')
{
// If the filename is the predefined value = '_csim_special_'
// we assume that the call to stroke only needs to do enough
// to correctly generate the CSIM maps.
Method DoDateAutoScale
has 96 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function DoDateAutoScale($aStartTime, $aEndTime, $aDensity = 0, $aAdjust = true)
{
// Format of array
// array ( Decision point, array( array( Major-scale-step-array ),
// array( Minor-scale-step-array ),
PiePlot
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class PiePlot
{
public $posx = 0.5;
public $posy = 0.5;
public $is_using_plot_theme = false;
AxisPrototype
has 31 functions (exceeds 20 allowed). Consider refactoring. Open
class AxisPrototype
{
public $scale;
public $img;
public $hide = false;
Function _doAutoTickPos
has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring. Open
public function _doAutoTickPos($aScale)
{
$maj_step_abs = $aScale->scale_factor * $this->major_step;
$min_step_abs = $aScale->scale_factor * $this->minor_step;
- 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 ImgData_Squares
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function ImgData_Squares()
{
/*
*sq_lblue.png
*/
Method IntAutoScale
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function IntAutoScale($img, $min, $max, $maxsteps, $majend = true)
{
// Make sure limits are integers
$min = floor($min);
$max = ceil($max);
Method doAutoscaleXAxis
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doAutoscaleXAxis()
{
$aPlots = array_filter($this->plots, function ($plot) {
//\Kint::dump($plot, $plot instanceof Plot\Plot);
return $plot instanceof Plot\Plot;
Consider simplifying this complex logical expression. Open
if (($da <= 90 && ($a <= 90 && $ne > 90)) ||
(($da <= 180 && $da > 90) && (($a < 90 || $a >= 270) && $ne > 90))) {
$split = 90;
} elseif (($da <= 90 && ($a <= 270 && $ne > 270)) ||
(($da <= 180 && $da > 90) && ($a >= 90 && $a < 270 && ($a + $da) > 270))) {
Text
has 30 functions (exceeds 20 allowed). Consider refactoring. Open
class Text //extends Graph
{
public $t;
public $x = 0;
public $y = 0;