Showing 6,805 of 6,805 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
$this->imgdata_large[0][1] =
'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAAByF' .
'BMVEX/////////xsb/vb3/lIz/hIT/e3v/c3P/c2v/a2v/Y2P/' .
'UlL/Skr/SkL/Qjn/MTH/MSn/KSn/ISH/IRj/GBj/GBD/EBD/EA' .
'j/CAj/CAD/AAD3QkL3MTH3KSn3KSH3GBj3EBD3CAj3AAD1zMzv' .
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 129.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Method Stroke
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Stroke($aFileName = '')
{
// Find out the necessary size for the container image
$w = 0;
$h = 0;
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function Max()
{
list($xmax, $ymax) = $this->plots[0]->Max();
$n = safe_count($this->plots);
for ($i = 0; $i < $n; ++$i) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 128.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
public function Min()
{
list($xmin, $ymin) = $this->plots[0]->Min();
$n = safe_count($this->plots);
for ($i = 0; $i < $n; ++$i) {
- Read upRead up
Duplicated Code
Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:
Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.
When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).
Tuning
This issue has a mass of 128.
We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.
The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.
If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.
See codeclimate-duplication
's documentation for more information about tuning the mass threshold in your .codeclimate.yml
.
Refactorings
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
GanttGraph
has 22 functions (exceeds 20 allowed). Consider refactoring. Open
class GanttGraph extends Graph
{
public $scale; // Public accessible
public $hgrid;
private $iObj = []; // Gantt objects
Method __construct
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function __construct()
{
/*
* File: bullets_balls_red_013.png
*/
Method StrokeAxisLabelBackground
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function StrokeAxisLabelBackground()
{
// Types
// 0 = No background
// 1 = Only X-labels, length of axis
Method Stroke
has 58 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Stroke($aImg, $aXLeft, $aYTop, $aXRight, $aYBottom, $aUseTextHeight = false)
{
if (!$this->iShow) {
return;
}
Method Legend
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Legend($graph)
{
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
Method AdjustMarginsForTitles
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function AdjustMarginsForTitles()
{
$totrequired =
($this->title->t != ''
? $this->title->GetTextHeight($this->img) + $this->title->margin + 5 * SUPERSAMPLING_SCALE
Method doAutoScaleYnAxis
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function doAutoScaleYnAxis()
{
if ($this->y2scale != null) {
if (!$this->y2scale->IsSpecified() && safe_count($this->y2plots) > 0) {
list($min, $max) = $this->GetPlotsYMinMax($this->y2plots);
Method Get
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
public static function Get($aSymb, $aCapital = false)
{
$iSymbols = [
/* Greek */
['alpha', '03B1', '0391'],
Method _doAutoTickPos
has 57 lines of code (exceeds 25 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;
Function StrokeLabels
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function StrokeLabels($label, $img, $a, $xp, $yp, $z)
{
$this->value->halign = 'left';
$this->value->valign = 'top';
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
public function Stroke($aImg, $aScale)
{
// Put the mark in the middle at the middle of the day
$d = $aScale->NormalizeDate($this->iStart) + SECPERDAY / 2;
$x = $aScale->TranslateDate($d);
- 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 AdjPercentage
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function AdjPercentage($aData, $aPrec = 0)
{
$mul = 100;
if ($aPrec > 0 && $aPrec < 3) {
if ($aPrec == 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
Function doDaily
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public static function doDaily($aType, $aMinor = false)
{
$m = self::$startmonth;
$y = self::$startyear;
$d = self::$startday;
- 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 StrokeYears
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
public function StrokeYears($aYCoord, $getHeight = false)
{
if ($this->year->iShowLabels) {
$img = $this->iImg;
$yt = $aYCoord + $img->top_margin;
- 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 17 (exceeds 5 allowed). Consider refactoring. Open
public function Stroke($pos, $dummy = true)
{
$this->img->SetLineWeight($this->weight);
$this->img->SetColor($this->color);
$this->img->SetFont($this->font_family, $this->font_style, $this->font_size);
- 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 Legend
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
public function Legend($graph)
{
$colors = array_keys($graph->img->rgb->rgb_table);
sort($colors);
$ta = $this->themearr[$this->theme];