HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

Method doDaily has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public static function doDaily($aType, $aMinor = false)
    {
        $m = self::$startmonth;
        $y = self::$startyear;
        $d = self::$startday;
Severity: Minor
Found in src/util/DateScaleUtils.php - About 1 hr to fix

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

            if ($sa < $ea) {
                while ($a <= 2 * M_PI) {
                    $xp = floor($radius * cos($a) + $xc);
                    $yp = floor($yc - $radius * sin($a));
                    $coords .= ", ${xp}, ${yp}";
    Severity: Major
    Found in src/plot/PiePlot.php and 1 other location - About 1 hr to fix
    src/plot/PiePlotC.php on lines 93..101

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

    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 2 locations. Consider refactoring.
    Open

            if ($sa < $ea) {
                while ($a <= 2 * M_PI) {
                    $xp = floor($radius * cos($a) + $xc);
                    $yp = floor($yc - $radius * sin($a));
                    $coords .= ", ${xp}, ${yp}";
    Severity: Major
    Found in src/plot/PiePlotC.php and 1 other location - About 1 hr to fix
    src/plot/PiePlot.php on lines 193..201

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

    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 4 locations. Consider refactoring.
    Open

                                case CONSTRAIN_STARTEND:
                                    if ($c1[1] < $c2[1]) {
                                        $link = new Image\GanttLink($c1[0], $c1[3], $c2[2], $c2[1]);
                                    } else {
                                        $link = new Image\GanttLink($c1[0], $c1[1], $c2[2], $c2[3]);
    Severity: Major
    Found in src/graph/GanttGraph.php and 3 other locations - About 1 hr to fix
    src/graph/GanttGraph.php on lines 856..864
    src/graph/GanttGraph.php on lines 874..882
    src/graph/GanttGraph.php on lines 883..891

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

    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 4 locations. Consider refactoring.
    Open

                                case CONSTRAIN_STARTSTART:
                                    if ($c1[1] < $c2[1]) {
                                        $link = new Image\GanttLink($c1[0], $c1[3], $c2[0], $c2[1]);
                                    } else {
                                        $link = new Image\GanttLink($c1[0], $c1[1], $c2[0], $c2[3]);
    Severity: Major
    Found in src/graph/GanttGraph.php and 3 other locations - About 1 hr to fix
    src/graph/GanttGraph.php on lines 856..864
    src/graph/GanttGraph.php on lines 865..873
    src/graph/GanttGraph.php on lines 874..882

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

    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 4 locations. Consider refactoring.
    Open

                                case CONSTRAIN_ENDEND:
                                    if ($c1[1] < $c2[1]) {
                                        $link = new Image\GanttLink($c1[2], $c1[3], $c2[2], $c2[1]);
                                    } else {
                                        $link = new Image\GanttLink($c1[2], $c1[1], $c2[2], $c2[3]);
    Severity: Major
    Found in src/graph/GanttGraph.php and 3 other locations - About 1 hr to fix
    src/graph/GanttGraph.php on lines 856..864
    src/graph/GanttGraph.php on lines 865..873
    src/graph/GanttGraph.php on lines 883..891

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

    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 4 locations. Consider refactoring.
    Open

                                case CONSTRAIN_ENDSTART:
                                    if ($c1[1] < $c2[1]) {
                                        $link = new Image\GanttLink($c1[2], $c1[3], $c2[0], $c2[1]);
                                    } else {
                                        $link = new Image\GanttLink($c1[2], $c1[1], $c2[0], $c2[3]);
    Severity: Major
    Found in src/graph/GanttGraph.php and 3 other locations - About 1 hr to fix
    src/graph/GanttGraph.php on lines 865..873
    src/graph/GanttGraph.php on lines 874..882
    src/graph/GanttGraph.php on lines 883..891

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

    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

    Method _StrokeTicks has 42 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function _StrokeTicks($aImg, $aScale, $aPos)
        {
            $hor = $aScale->type == 'x';
            $aImg->SetLineWeight($this->weight);
    
    
    Severity: Minor
    Found in src/graph/LinearTicks.php - About 1 hr to fix

      Method StrokeLabels has 42 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function StrokeLabels($aImg, $xc, $yc, $ri, $rr)
          {
              if ($this->iHideLabels) {
                  return;
              }
      Severity: Minor
      Found in src/graph/WindrosePlotScale.php - About 1 hr to fix

        Method StrokeTitle has 42 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function StrokeTitle($image, $w, $h)
            {
                // Stroke title
                if ($this->title->t !== '') {
                    $margin = 3;
        Severity: Minor
        Found in src/graph/MGraph.php - About 1 hr to fix

          Avoid excessively long variable names like $supress_minor_tickmarks. Keep variable name length under 20.
          Open

              public $supress_minor_tickmarks = false;
          Severity: Minor
          Found in src/graph/Ticks.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#longvariable

          Avoid excessively long variable names like $iSimpleProgressBkgColor. Keep variable name length under 20.
          Open

              private $iSimpleProgressBkgColor = 'gray';
          Severity: Minor
          Found in src/graph/GanttGraph.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#longvariable

          Avoid excessively long variable names like $titlebackground_style. Keep variable name length under 20.
          Open

              public $titlebackground_style = 1;
          Severity: Minor
          Found in src/graph/Graph.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#longvariable

          Avoid excessively long variable names like $titlebackground_framecolor. Keep variable name length under 20.
          Open

              public $titlebackground_framecolor;
          Severity: Minor
          Found in src/graph/Graph.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#longvariable

          Avoid excessively long variable names like $titlebackground_frameweight. Keep variable name length under 20.
          Open

              public $titlebackground_frameweight;
          Severity: Minor
          Found in src/graph/Graph.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#longvariable

          Avoid excessively long variable names like $framebevelbordercolor. Keep variable name length under 20.
          Open

              public $framebevelbordercolor;
          Severity: Minor
          Found in src/graph/Graph.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#longvariable

          Avoid excessively long variable names like $background_cflag_type. Keep variable name length under 20.
          Open

              public $background_cflag_type = BGIMG_FILLPLOT;
          Severity: Minor
          Found in src/graph/Graph.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#longvariable

          Avoid excessively long variable names like $background_image_bright. Keep variable name length under 20.
          Open

              public $background_image_bright = 0;
          Severity: Minor
          Found in src/graph/Graph.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#longvariable

          Avoid excessively long variable names like $titlebackground_color. Keep variable name length under 20.
          Open

              public $titlebackground_color = 'lightblue';
          Severity: Minor
          Found in src/graph/Graph.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#longvariable

          Avoid excessively long variable names like $iTableHeaderBackgroundColor. Keep variable name length under 20.
          Open

              private $iTableHeaderBackgroundColor = 'white';
          Severity: Minor
          Found in src/graph/GanttScale.php by phpmd

          LongVariable

          Since: 0.2

          Detects when a field, formal or local variable is declared with a long name.

          Example

          class Something {
              protected $reallyLongIntName = -3; // VIOLATION - Field
              public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                  $otherReallyLongName = -5; // VIOLATION - Local
                  for ($interestingIntIndex = 0; // VIOLATION - For
                       $interestingIntIndex < 10;
                       $interestingIntIndex++ ) {
                  }
              }
          }

          Source https://phpmd.org/rules/naming.html#longvariable

          Severity
          Category
          Status
          Source
          Language