Showing 706 of 6,805 total issues
Function Color
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function Color($aColor)
{
if (is_string($aColor)) {
$matches = [];
// this regex will parse a color string and fill the $matches array as such:
- 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 File
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function File($family, $style = FS_NORMAL, $font_path = null)
{
$fam = @$this->font_files[$family];
if (!$fam) {
Util\JpGraphError::RaiseL(25046, $family); //("Specified TTF font family (id=$family) is unknown or does not exist. Please note that TTF fonts are not distributed with JpGraph for copyright reasons. You can find the MS TTF WEB-fonts (arial, courier etc) for download at http://corefonts.sourceforge.net/");
- 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 StrokeMonths
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function StrokeMonths($aYCoord, $getHeight = false)
{
if ($this->month->iShowLabels) {
$img = $this->iImg;
$img->SetFont($this->month->iFFamily, $this->month->iFStyle, $this->month->iFSize);
- 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 21 (exceeds 5 allowed). Consider refactoring. Open
public function Stroke($aStrokeFileName = '')
{
// Start by adjusting the margin so that potential titles will fit.
$this->AdjustMarginsForTitles();
- 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 LinearTicks.php
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* JPGraph v4.0.3
*/
Method StrokeMinutes
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function StrokeMinutes($aYCoord, $getHeight = false)
{
$img = $this->iImg;
$xt = $img->left_margin + $this->iLabelWidth;
$yt = $aYCoord + $img->top_margin;
Method CreateSimple
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function CreateSimple($data, $constrains = [], $progress = [])
{
$num = safe_count($data);
for ($i = 0; $i < $num; ++$i) {
switch ($data[$i][1]) {
Method Stroke
has 70 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.
Function SetImgFormat
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function SetImgFormat($aFormat, $aQuality = 75)
{
$this->quality = $aQuality;
$aFormat = strtolower($aFormat);
$tst = true;
- 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 AdjustMarginsForGrid
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public function AdjustMarginsForGrid()
{
if ($this->iCol > 0) {
switch ($this->iGridStyle[0]) {
case TGRID_SINGLE:
- 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 LoadBkgImage
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
public static function LoadBkgImage($aImgFormat = '', $aFile = '', $aImgStr = '')
{
if ($aImgStr != '') {
return Image::CreateFromString($aImgStr);
}
- 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 StrokeConstrains
has 68 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function StrokeConstrains()
{
$n = safe_count($this->iObj);
// Stroke all constrains
File UnitTesterActions.php
has 278 lines of code (exceeds 250 allowed). Consider refactoring. Open
<?php
/**
* JPGraph - Community Edition
*/
Method Stroke
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Stroke($aImg, $aDummy1 = null, $aDummy2 = null)
{
if ($this->hide) {
return;
}
Method StrokeWeeks
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function StrokeWeeks($aYCoord, $getHeight = false)
{
if ($this->week->iShowLabels) {
$img = $this->iImg;
$yt = $aYCoord + $img->top_margin;
Method Stroke
has 66 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Stroke($aImg, &$grid, $aPos, $aAxisAngle, $aScale, &$aMajPos, &$aMajLabel)
{
$start = $aScale->GetMinVal();
$limit = $aScale->GetMaxVal();
$nextMajor = 10 * $start;
Method StrokeLabel
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function StrokeLabel($label, $img, $xc, $yc, $a, $r)
{
// Default value
if ($this->ilabelposadj === 'auto') {
$this->ilabelposadj = 0.65;
Method AdjTime
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function AdjTime($aTime, $aRound = 0, $aHourType = false, $aMinType = false, $aSecType = false)
{
$y = (int) date('Y', $aTime);
$m = (int) date('m', $aTime);
$d = (int) date('d', $aTime);
Method StrokeMonths
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function StrokeMonths($aYCoord, $getHeight = false)
{
if ($this->month->iShowLabels) {
$img = $this->iImg;
$img->SetFont($this->month->iFFamily, $this->month->iFStyle, $this->month->iFSize);
Function Stroke
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
public function Stroke($pos, $aAxisAngle, &$grid, $title, $lf)
{
$this->img->SetColor($this->color);
// Determine end points for the axis
- 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"