HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

Method FilledRectangle2 has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function FilledRectangle2($xl, $yu, $xr, $yl, $color1, $color2, $style = 1)
    {
        // Fill a rectangle with lines of two colors
        if ($style === 1) {
            // Horizontal stripe
Severity: Minor
Found in src/image/Image.php - About 1 hr to fix

    Method Stroke has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function Stroke()
        {
            $n = strlen($this->iData);
            if ($n == 0) {
                return false;
    Severity: Minor
    Found in src/image/AntiSpam.php - About 1 hr to fix

      Method SetupGraph has 27 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function SetupGraph($graph)
          {
              // graph
              /*
              $img = $graph->img;
      Severity: Minor
      Found in src/themes/UniversalTheme.php - About 1 hr to fix

        Method GetTicksFromMinMax has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public static function GetTicksFromMinMax($aMin, $aMax, $aType, $aMinor = false, $aEndPoints = false)
            {
                self::$starthour  = date('G', $aMin);
                self::$startmonth = date('n', $aMin);
                self::$startday   = date('j', $aMin);
        Severity: Minor
        Found in src/util/DateScaleUtils.php - About 1 hr to fix

          Method GetHeaderHeight has 27 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function GetHeaderHeight()
              {
                  $img    = $this->iImg;
                  $height = 1;
                  if ($this->minute->iShowLabels) {
          Severity: Minor
          Found in src/graph/GanttScale.php - About 1 hr to fix

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

                                case DSUTILS_MONTH3:
                                    if ($aMinor) {
                                        // Set minor tick at start of each month
                                        self::$minTickPositions[$j++] = mktime(0, 0, 0, $m, 1, $y);
                                    }
            Severity: Major
            Found in src/util/DateScaleUtils.php and 2 other locations - About 1 hr to fix
            src/util/DateScaleUtils.php on lines 256..268
            src/util/DateScaleUtils.php on lines 281..292

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

            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

                                case DSUTILS_MONTH6:
                                    if ($aMinor) {
                                        // Set minor tick at start of each month
                                        self::$minTickPositions[$j++] = mktime(0, 0, 0, $m, 1, $y);
                                    }
            Severity: Major
            Found in src/util/DateScaleUtils.php and 2 other locations - About 1 hr to fix
            src/util/DateScaleUtils.php on lines 256..268
            src/util/DateScaleUtils.php on lines 269..280

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

            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

                                case DSUTILS_MONTH2:
                                    if ($aMinor) {
                                        // Set minor tick at start of each month
                                        self::$minTickPositions[$j++] = mktime(0, 0, 0, $m, 1, $y);
                                    }
            Severity: Major
            Found in src/util/DateScaleUtils.php and 2 other locations - About 1 hr to fix
            src/util/DateScaleUtils.php on lines 269..280
            src/util/DateScaleUtils.php on lines 281..292

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

            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 getHeight has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function getHeight($aImg)
                {
                    $scaling = 1; //$this->iAntiAlias ? 2 : 1 ;
                    if ($this->iSize > 0 && $this->iSize < 1) {
                        $this->iSize *= min($aImg->width, $aImg->height);
            Severity: Minor
            Found in src/plot/WindrosePlot.php - About 1 hr to fix

              Method Min has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function Min()
                  {
                      $nmax                 = 0;
                      list($xmin, $ysetmin) = $this->plots[0]->Min();
                      for ($i = 0; $i < safe_count($this->plots); ++$i) {
              Severity: Minor
              Found in src/plot/AccBarPlot.php - About 1 hr to fix

                Method CakeSlice has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function CakeSlice($xc, $yc, $w, $h, $s, $e, $fillcolor = '', $arccolor = '')
                    {
                        $s  = round($s);
                        $e  = round($e);
                        $w  = round($w);
                Severity: Minor
                Found in src/image/Image.php - About 1 hr to fix

                  Method SetupGraph has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function SetupGraph($graph)
                      {
                          // graph
                          /*
                          $img = $graph->img;
                  Severity: Minor
                  Found in src/themes/OrangeTheme.php - About 1 hr to fix

                    Method SetupGraph has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function SetupGraph($graph)
                        {
                            // graph
                            /*
                            $img = $graph->img;
                    Severity: Minor
                    Found in src/themes/RoseTheme.php - About 1 hr to fix

                      Method SetupGraph has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function SetupGraph($graph)
                          {
                              // graph
                              /*
                              $img = $graph->img;
                      Severity: Minor
                      Found in src/themes/OceanTheme.php - About 1 hr to fix

                        Method __construct has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function __construct($xdata, $ydata)
                            {
                                $this->y2    = [];
                                $this->xdata = $xdata;
                                $this->ydata = $ydata;
                        Severity: Minor
                        Found in src/util/Spline.php - About 1 hr to fix

                          Method _autoSizeTable has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function _autoSizeTable($aImg)
                              {
                                  // Get maximum column width and row height
                                  $m = $this->iSize[0];
                                  $n = $this->iSize[1];
                          Severity: Minor
                          Found in src/text/GTextTable.php - About 1 hr to fix

                            Method SetupGraph has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function SetupGraph($graph)
                                {
                                    // graph
                                    /*
                                    $img = $graph->img;
                            Severity: Minor
                            Found in src/themes/VividTheme.php - About 1 hr to fix

                              Method SetupGraph has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function SetupGraph($graph)
                                  {
                                      // graph
                                      /*
                                      $img = $graph->img;
                              Severity: Minor
                              Found in src/themes/AquaTheme.php - About 1 hr to fix

                                Method SetupGraph has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    public function SetupGraph($graph)
                                    {
                                        // graph
                                        /*
                                        $img = $graph->img;
                                Severity: Minor
                                Found in src/themes/GreenTheme.php - About 1 hr to fix

                                  Method SetupGraph has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      public function SetupGraph($graph)
                                      {
                                          // graph
                                          /*
                                          $img = $graph->img;
                                  Severity: Minor
                                  Found in src/themes/PastelTheme.php - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language