Showing 6,805 of 6,805 total issues
Avoid using undefined variables such as '$delta' which will lead to PHP notices. Open
$delta[$i] = (6.0 * $delta[$i] / ($xdata[$i + 1] - $xdata[$i - 1]) - $s * $delta[$i - 1]) / $p;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$delta' which will lead to PHP notices. Open
$delta[$i] = (6.0 * $delta[$i] / ($xdata[$i + 1] - $xdata[$i - 1]) - $s * $delta[$i - 1]) / $p;
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Avoid using undefined variables such as '$i' which will lead to PHP notices. Open
$tickPositions[$i++] = $aData[0];
- Read upRead up
- Exclude checks
UndefinedVariable
Since: 2.8.0
Detects when a variable is used that has not been defined before.
Example
class Foo
{
private function bar()
{
// $message is undefined
echo $message;
}
}
Source https://phpmd.org/rules/cleancode.html#undefinedvariable
Method StrokeBackgroundGrad
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function StrokeBackgroundGrad()
{
if ($this->bkg_gradtype < 0) {
return;
}
Method Create
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Create($aPattern, $aColor, $aWeight = 1)
{
switch ($aPattern) {
case BAND_RDIAG:
$obj = new RectPatternRDiag($aColor, $aWeight);
Method _normalizeTestGroup
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
private function _normalizeTestGroup($filename, &$ownFixtures = [], $example_title = 'file_iterator', $debug = false, $attributes = [])
{
$filename_meaningful = \explode('ex', $filename)[0];
if ('file_iterator' === $example_title) {
Method _TransHor3D
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function _TransHor3D($aGdImg, $aHorizon = 100, $aSkewDist = 120, $aDir = SKEW3D_LEFT, $aMinSize = true, $aFillColor = '#FFFFFF', $aQuality = false, $aBorder = false, $aHorizonPos = 0.5)
Method Copy
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function Copy($fromImg, $toX, $toY, $fromX, $fromY, $toWidth, $toHeight, $fromWidth = -1, $fromHeight = -1)
Method DrawImageSmoothArc
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function DrawImageSmoothArc($im, $xc, $yc, $w, $h, $s, $e, $color, $style = null)
Method _TransVert3D
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function _TransVert3D($aGdImg, $aHorizon = 100, $aSkewDist = 120, $aDir = SKEW3D_DOWN, $aMinSize = true, $aFillColor = '#FFFFFF', $aQuality = false, $aBorder = false, $aHorizonPos = 0.5)
Method IndentedRectangle
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
public function IndentedRectangle($xt, $yt, $w, $h, $iw = 0, $ih = 0, $aCorner = 3, $aFillColor = '', $r = 4)
Method StrokeNumber
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function StrokeNumber($aValStr, $aColor = 0, $aFileName = '')
{
if ($aColor < 0 || $aColor >= safe_count($this->iColorSchema)) {
$aColor = 0;
}
Method GetIdxByName
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function GetIdxByName($aName, &$outFullName)
{
if (is_integer($aName)) {
$idx = $this->GetIdxByOrdinal($aName, $outFullName);
Method FastStroke
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function FastStroke($img, $xscale, $yscale, $aStartPoint = 0, $exist_x = true)
{
// An optimized stroke for many data points with no extra
// features but 60% faster. You can't have values or line styles, or null
// values in plots.
Method Add
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Add($aPlot)
{
if ($aPlot == null) {
Util\JpGraphError::RaiseL(25010); //("Graph::Add() You tried to add a null plot to the graph.");
}
Method __construct
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct($aWidth = null, $aHeight = null, $aCachedName = '', $aTimeOut = 0, $aInline = true)
{
$this->iWidth = $aWidth;
$this->iHeight = $aHeight;
Function __construct
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function __construct($aMatrix, $aIsobars = 10, $aColors = null)
{
$this->nbrRows = safe_count($aMatrix);
$this->nbrCols = safe_count($aMatrix[0]);
$this->dataPoints = $aMatrix;
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
public function Stroke($img, $aaoption = 0)
{
// Stroke the pie but don't stroke values
$tmp = $this->value->show;
$this->value->show = 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 adjustDataPointValues
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function adjustDataPointValues()
{
$ni = safe_count($this->isobarValues);
for ($k = 0; $k < $ni; ++$k) {
$ib = $this->isobarValues[$k];
- 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 Min
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
public function Min()
{
$nmax = 0;
list($xmin, $ysetmin) = $this->plots[0]->Min();
for ($i = 0; $i < safe_count($this->plots); ++$i) {
- 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"