HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class GanttTest extends \Codeception\Test\Unit
Severity: Minor
Found in tests/GanttTest.php by phpcodesniffer

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class PdfTest extends \Codeception\Test\Unit

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class TablesTest extends \Codeception\Test\Unit

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class PolarTest extends \Codeception\Test\Unit

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class StockTest extends \Codeception\Test\Unit

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class OdometerTest extends \Codeception\Test\Unit

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

class UnitWizard extends \Codeception\Actor

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

    class Kint
Severity: Minor
Found in src/includes/polyfills.php by phpcodesniffer

Each class must be in a namespace of at least one level (a top-level vendor name)
Open

    class PC
Severity: Minor
Found in src/includes/polyfills.php by phpcodesniffer

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                } elseif ($a > $ca1 && $a < $ca2) {
                    $xt = $x0 + $h * $x / $y;
                    $yt = $ytop - $margin;
                    if ($rot90) {
                        $ha = 'left';
Severity: Major
Found in src/graph/PolarAxis.php and 2 other locations - About 1 hr to fix
src/graph/PolarAxis.php on lines 274..287
src/graph/PolarAxis.php on lines 354..367

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 100.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                } elseif ($a >= $ca2 && $a <= $ca3) {
                    $yt = $pos + $w * $y / $x;
                    $xt = $xleft - $margin;
                    if ($rot90) {
                        $ha = 'center';
Severity: Major
Found in src/graph/PolarAxis.php and 2 other locations - About 1 hr to fix
src/graph/PolarAxis.php on lines 261..274
src/graph/PolarAxis.php on lines 354..367

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 100.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                    if ($this->label_formfunc != '') {
                        $f                         = $this->label_formfunc;
                        $this->maj_ticks_label[$i] = call_user_func($f, $nextMajor);
                    } elseif ($this->label_logtype == 0) {
                        $this->maj_ticks_label[$i] = $nextMajor;
Severity: Minor
Found in src/graph/LogTicks.php and 1 other location - About 1 hr to fix
src/graph/LogTicks.php on lines 112..119

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 100.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                if ($a <= $ca1 || $a >= $ca4) {
                    $yt = $pos - $w * $y / $x;
                    $xt = $xright + $margin;
                    if ($rot90) {
                        $ha = 'center';
Severity: Major
Found in src/graph/PolarAxis.php and 2 other locations - About 1 hr to fix
src/graph/PolarAxis.php on lines 287..300
src/graph/PolarAxis.php on lines 328..367

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 100.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                if ($a <= $ca1) {
                    $yt = $pos - $w * $y / $x;
                    $xt = $xright + $margin;
                    if ($rot90) {
                        $ha = 'center';
Severity: Major
Found in src/graph/PolarAxis.php and 2 other locations - About 1 hr to fix
src/graph/PolarAxis.php on lines 248..300
src/graph/PolarAxis.php on lines 287..300

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 100.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                } elseif ($a >= $ca2) {
                    $yt = $pos + $w * $y / $x;
                    $xt = $xleft - $margin;
                    if ($rot90) {
                        $ha = 'center';
Severity: Major
Found in src/graph/PolarAxis.php and 2 other locations - About 1 hr to fix
src/graph/PolarAxis.php on lines 261..274
src/graph/PolarAxis.php on lines 274..287

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 100.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                    if ($this->label_formfunc != '') {
                        $f                         = $this->label_formfunc;
                        $this->maj_ticks_label[$i] = call_user_func($f, $nextMajor);
                    } elseif ($this->label_logtype == 0) {
                        $this->maj_ticks_label[$i] = $nextMajor;
Severity: Minor
Found in src/graph/LogTicks.php and 1 other location - About 1 hr to fix
src/graph/LogTicks.php on lines 166..173

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 100.

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

Further Reading

Similar blocks of code found in 3 locations. Consider refactoring.
Open

                } else {
                    $xt = $x0 - $h * $x / $y;
                    $yt = $ybottom + $margin;
                    if ($rot90) {
                        $ha = 'right';
Severity: Major
Found in src/graph/PolarAxis.php and 2 other locations - About 1 hr to fix
src/graph/PolarAxis.php on lines 248..300
src/graph/PolarAxis.php on lines 328..367

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 100.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                    if ($step == 0 || $i % $step == 0 && $j < $nbrmajticks) {
                        $this->maj_ticks_pos[$j]      = round($abs_pos);
                        $this->maj_ticklabels_pos[$j] = round($abs_pos);
                        $this->maj_ticks_label[$j]    = $this->_doLabelFormat($label, $j, $nbrmajticks);
                        ++$j;
Severity: Minor
Found in src/graph/LinearTicks.php and 1 other location - About 55 mins to fix
src/graph/LinearTicks.php on lines 210..215

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 99.

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

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

                    if ($step == 0 || $i % $step == 0 && $j < $nbrmajticks) {
                        $this->maj_ticks_pos[$j]      = round($abs_pos);
                        $this->maj_ticklabels_pos[$j] = round($abs_pos);
                        $this->maj_ticks_label[$j]    = $this->_doLabelFormat($label, $j, $nbrmajticks);
                        ++$j;
Severity: Minor
Found in src/graph/LinearTicks.php and 1 other location - About 55 mins to fix
src/graph/LinearTicks.php on lines 191..196

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 99.

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

Further Reading

Function getCrossingCoord has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

    public function getCrossingCoord($aRow, $aCol, $aEdgeDir, $aIsobarVal)
    {
        // In order to avoid numerical problem when two vertices are very close
        // we have to check and avoid dividing by close to zero denumerator.
        if ($aEdgeDir == HORIZ_EDGE) {
Severity: Minor
Found in src/plot/Contour.php - About 55 mins to fix

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

Severity
Category
Status
Source
Language