HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Method CopyMerge has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function CopyMerge($fromImg, $toX, $toY, $fromX, $fromY, $toWidth, $toHeight, $fromWidth = -1, $fromHeight = -1, $aMix = 100)
    {
        if ($aMix == 100) {
            $this->CopyCanvasH(
                $this->img,
Severity: Minor
Found in src/image/Image.php - About 1 hr to fix

    Method GetBBoxTTF has 38 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function GetBBoxTTF($aTxt, $aAngle = 0)
        {
            // Normalize the bounding box to become a minimum
            // enscribing rectangle
    
    
    Severity: Minor
    Found in src/image/Image.php - About 1 hr to fix

      Method LoadBkgImage has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public static function LoadBkgImage($aImgFormat = '', $aFile = '', $aImgStr = '')
          {
              if ($aImgStr != '') {
                  return Image::CreateFromString($aImgStr);
              }
      Severity: Minor
      Found in src/graph/Graph.php - About 1 hr to fix

        Method StrokeBoxedText2 has 12 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $x,
                $y,
                $txt,
                $dir = 0,
                $fcolor = 'white',
        Severity: Major
        Found in src/image/Image.php - About 1 hr to fix

          Method StrokeBoxedText has 12 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $x,
                  $y,
                  $txt,
                  $dir = 0,
                  $fcolor = 'white',
          Severity: Major
          Found in src/image/Image.php - About 1 hr to fix

            Method ShadowRectangle has 37 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function ShadowRectangle($xl, $yu, $xr, $yl, $fcolor = false, $shadow_width = 4, $shadow_color = 'darkgray', $useAlpha = true)
                {
                    // This is complicated by the fact that we must also handle the case where
                    // the reactangle has no fill color
                    $xl = floor($xl);
            Severity: Minor
            Found in src/image/Image.php - About 1 hr to fix

              Method SetFont has 37 lines of code (exceeds 25 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

                Method ApplyPlot has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function ApplyPlot($plot)
                    {
                        switch (get_class($plot)) {
                            case 'BarPlot':
                                    $plot->Clear();
                Severity: Minor
                Found in src/themes/SoftyTheme.php - About 1 hr to fix

                  Method File has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function File($family, $style = FS_NORMAL, $font_path = null)
                      {
                          $fam = @$this->font_files[$family];
                          if (!$fam) {
                              Util\JpGraphError::RaiseL(25046, $family); //("Specified TTF font family (id=$family) is unknown or does not exist. Please note that TTF fonts are not distributed with JpGraph for copyright reasons. You can find the MS TTF WEB-fonts (arial, courier etc) for download at http://corefonts.sourceforge.net/");
                  Severity: Minor
                  Found in src/text/TTF.php - About 1 hr to fix

                    Method GetPlotsYMinMax has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function GetPlotsYMinMax($bPlots)
                        {
                            $aPlots = array_filter($bPlots, function ($plot) {
                                //\Kint::dump($plot, $plot instanceof Plot\Plot);
                                return $plot instanceof Plot\Plot;
                    Severity: Minor
                    Found in src/graph/Graph.php - About 1 hr to fix

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

                          public function Stroke($aImg, $aXScale, $aYScale)
                          {
                              assert($this->prect != null);
                              if ($this->dir == HORIZONTAL) {
                                  if ($this->min === 'min') {
                      Severity: Minor
                      Found in src/plot/PlotBand.php - About 1 hr to fix

                        Method GetXMinMax has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            public function GetXMinMax()
                            {
                                list($min, $ymin) = $this->plots[0]->Min();
                                list($max, $ymax) = $this->plots[0]->Max();
                        
                        
                        Severity: Minor
                        Found in src/graph/Graph.php - About 1 hr to fix

                          Method IntCalcTicks has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function IntCalcTicks($maxsteps, $min, $max, $a, $majend = true)
                              {
                                  $diff = $max - $min;
                                  if ($diff == 0) {
                                      Util\JpGraphError::RaiseL(25075); //('Can\'t automatically determine ticks since min==max.');
                          Severity: Minor
                          Found in src/graph/LinearScale.php - About 1 hr to fix

                            Method _doManualTickPos has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                public function _doManualTickPos($aScale)
                                {
                                    $n     = safe_count($this->iManualTickPos);
                                    $m     = safe_count($this->iManualMinTickPos);
                                    $doLbl = safe_count($this->iManualTickLabels) > 0;
                            Severity: Minor
                            Found in src/graph/LinearTicks.php - About 1 hr to fix

                              Method doAutoScaleYAxis has 36 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  public function doAutoScaleYAxis()
                                  {
                                      //Check if we should autoscale y-axis
                                      if (!$this->yscale->IsSpecified() && safe_count($this->plots) > 0) {
                                          list($min, $max) = $this->GetPlotsYMinMax($this->plots);
                              Severity: Minor
                              Found in src/graph/Graph.php - About 1 hr to fix

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

                                    public function AddSliceToCSIM($i, $xc, $yc, $radius, $sa, $ea)
                                    {
                                        //Slice number, ellipse centre (x,y), height, width, start angle, end angle
                                        while ($sa > 2 * M_PI) {
                                            $sa = $sa - 2 * M_PI;
                                Severity: Minor
                                Found in src/plot/PiePlot.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 Add3DSliceToCSIM has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function Add3DSliceToCSIM($i, $xc, $yc, $height, $width, $thick, $sa, $ea)
                                    {
                                        //Slice number, ellipse centre (x,y), height, width, start angle, end angle
                                
                                        $sa *= M_PI / 180;
                                Severity: Minor
                                Found in src/plot/PiePlot3D.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 Set has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function Set($aLocale)
                                    {
                                        if (in_array($aLocale, array_keys($this->iDayAbb), true)) {
                                            $this->iLocale = $aLocale;
                                
                                
                                Severity: Minor
                                Found in src/util/DateLocale.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 Stream has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function Stream($aFile = '')
                                    {
                                        $this->DoSupersampling();
                                
                                        $func = 'image' . $this->img_format;
                                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 SetLineStyle has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
                                Open

                                    public function SetLineStyle($s)
                                    {
                                        if (is_numeric($s)) {
                                            if ($s < 1 || $s > 4) {
                                                Util\JpGraphError::RaiseL(25101, $s); //(" Illegal numeric argument to SetLineStyle(): ($s)");
                                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

                                Severity
                                Category
                                Status
                                Source
                                Language