HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

Method DoPattern has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function DoPattern($aImg)
    {
        //  --------------------
        //  | /   /   /   /   /|
        //  |/   /   /   /   / |
Severity: Minor
Found in src/graph/RectPatternRDiag.php - About 1 hr to fix

    Method Pie3D has 13 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            $aaoption,
            $img,
            $data,
            $colors,
            $xc,
    Severity: Major
    Found in src/plot/PiePlot3D.php - About 1 hr to fix

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

      if (!\defined('TTF_DIR')) {
          if (\mb_strstr(\PHP_OS, 'WIN')) {
              if (empty(SYSTEMROOT)) {
                  $t = new ErrMsgText();
                  $msg = $t->Get(12, $file, $lineno);
      Severity: Major
      Found in src/config.inc.php and 1 other location - About 1 hr to fix
      src/config.inc.php on lines 544..556

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

      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

              $this->imgdata_large[5][1] =
                  'iVBORw0KGgoAAAANSUhEUgAAABoAAAAaCAMAAACelLz8AAABO1' .
                  'BMVEX////////3///39/fv7+/e5+fW3t7Wzs7WxsbG1tbGzsbG' .
                  'xsbDxMS/v7++wMC+v7+9zsa9xsa9vb29tbW9ra29pa24uLi1xs' .
                  'a1vb21tbWxtrattbWmpqalra2cra2cpaWcnJycjIyUpaWUnJyU' .
      Severity: Major
      Found in src/image/ImgData_Balls.php and 1 other location - About 1 hr to fix
      src/image/PredefIcons.php on lines 256..281

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

      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 (!\defined('MBTTF_DIR')) {
          if (\mb_strstr(\PHP_OS, 'WIN')) {
              if (empty(SYSTEMROOT)) {
                  $t = new ErrMsgText();
                  $msg = $t->Get(12, $file, $lineno);
      Severity: Major
      Found in src/config.inc.php and 1 other location - About 1 hr to fix
      src/config.inc.php on lines 527..539

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

      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

              $this->iBuiltinIcon[11][1] =
                  'iVBORw0KGgoAAAANSUhEUgAAACIAAAAiCAYAAAA6RwvCAAAABGdBTUEAALGPC/xhBQAAAAZiS0dEAAAAAAAA+UO7fwAAAAlwSFlz' .
                  'AAALEAAACxABrSO9dQAAAAd0SU1FB9ECAQgFFyd9cRUAAAadSURBVHiczdhvbBP3Hcfx9/2xfefEOA5JoCNNnIT8AdtZmYBETJsI' .
                  '6+jQOlQihT1AYgytqzZpD1atfyYqlT1h0lRpT7aRJ4NQpRvZGELVuo5Ua9jEJDIETQsNQyPBsUJMWGPnj//e+e72wNg4xElMR6ed' .
                  'ZNln3933dZ/f93f6yfB/sgmrHdDV1WXlPg8NDZUDScD8LFFFEZZlWYZhWMFg0Orq6sq/gDJAfFy1iiZy9OjrVnj4JzQ1rMWqfxm/' .
      Severity: Major
      Found in src/image/PredefIcons.php and 1 other location - About 1 hr to fix
      src/image/ImgData_Balls.php on lines 289..314

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

      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 Stroke has 40 lines of code (exceeds 25 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);
      Severity: Minor
      Found in src/plot/MileStone.php - About 1 hr to fix

        Method doWeekly has 40 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function doWeekly($aType, $aMinor = false)
            {
                $hpd = 3600 * 24;
                $hpw = 3600 * 24 * 7;
                // Find out week number of min date
        Severity: Minor
        Found in src/util/DateScaleUtils.php - About 1 hr to fix

          Method DoPattern has 40 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function DoPattern($aImg)
              {
                  //  --------------------
                  //  |\   \   \   \   \ |
                  //  | \   \   \   \   \|
          Severity: Minor
          Found in src/graph/RectPatternLDiag.php - About 1 hr to fix

            Function CalculateColors has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function CalculateColors()
                {
                    if ($this->highcontrast) {
                        if ($this->highcontrastbw) {
                            for ($ib = 0; $ib < $this->nbrIsobars; ++$ib) {
            Severity: Minor
            Found in src/plot/Contour.php - About 1 hr 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

            Function SetPattern has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function SetPattern($aPattern, $aColor = 'black')
                {
                    if (is_array($aPattern)) {
                        $n                     = safe_count($aPattern);
                        $this->iPattern        = [];
            Severity: Minor
            Found in src/plot/BarPlot.php - About 1 hr 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

            Function AddSliceToCSIM has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function AddSliceToCSIM($i, $xc, $yc, $radius, $sa, $ea)
                {
                    //Slice number, ellipse centre (x,y), radius, start angle, end angle
                    while ($sa > 2 * M_PI) {
                        $sa = $sa - 2 * M_PI;
            Severity: Minor
            Found in src/plot/PiePlotC.php - About 1 hr 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

            Function _Stroke has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function _Stroke($aImg, $x = null, $y = null, $aReturnWidthHeight = false)
                {
                    if ($this->iFile != '' && $this->iCountryFlag != '') {
                        Util\JpGraphError::RaiseL(8003); //('It is not possible to specify both an image file and a country flag for the same icon.');
                    }
            Severity: Minor
            Found in src/plot/IconPlot.php - About 1 hr 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

            Function Stroke has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function Stroke($img, $xscale, $yscale)
                {
                    $numpoints = safe_count($this->coords[0]) / 2;
                    $img->SetColor($this->color);
                    $img->SetLineWeight($this->weight);
            Severity: Minor
            Found in src/plot/ErrorPlot.php - About 1 hr 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

            Function doWeekly has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function doWeekly($aType, $aMinor = false)
                {
                    $hpd = 3600 * 24;
                    $hpw = 3600 * 24 * 7;
                    // Find out week number of min date
            Severity: Minor
            Found in src/util/DateScaleUtils.php - About 1 hr 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

            Function imageSmoothCircle has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function imageSmoothCircle(&$img, $cx, $cy, $cr, $color)
                {
                    $ir   = $cr;
                    $ix   = 0;
                    $iy   = $ir;
            Severity: Minor
            Found in src/image/Image.php - About 1 hr 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

            Function imagettfbbox_fixed has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function imagettfbbox_fixed($size, $angle, $fontfile, $text)
                {
                    if (!USE_LIBRARY_IMAGETTFBBOX) {
                        $bbox = @imagettfbbox($size, $angle, $fontfile, $text);
                        if ($bbox === false) {
            Severity: Minor
            Found in src/image/Image.php - About 1 hr 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

            Function GetAutoTicks has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public static function GetAutoTicks($aMin, $aMax, $aMaxTicks = 10, $aMinor = false)
                {
                    $diff = $aMax - $aMin;
                    $spd  = 3600 * 24;
                    $spw  = $spd * 7;
            Severity: Minor
            Found in src/util/DateScaleUtils.php - About 1 hr 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

            Function Stroke has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function Stroke($aImg, $aDummy1 = null, $aDummy2 = null)
                {
                    if ($this->hide) {
                        return;
                    }
            Severity: Minor
            Found in src/text/GraphTabTitle.php - About 1 hr 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

            Function SetFont has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
            Open

                public function SetFont()
                {
                    $numargs = func_num_args();
                    if ($numargs == 2 || $numargs == 3) {
                        $aFF = func_get_arg(0);
            Severity: Minor
            Found in src/text/GTextTable.php - About 1 hr 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