HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Function Min has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function Min()
    {
        if (isset($this->coords[1])) {
            $x = $this->coords[1];
        } else {
Severity: Minor
Found in src/plot/Plot.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 GetBBoxTTF has a Cognitive Complexity of 14 (exceeds 5 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

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 CopyMerge has a Cognitive Complexity of 14 (exceeds 5 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

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 GetIdxByName has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function GetIdxByName($aName, &$outFullName)
    {
        if (is_integer($aName)) {
            $idx = $this->GetIdxByOrdinal($aName, $outFullName);

Severity: Minor
Found in src/image/FlagImages.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 MergeCells has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function MergeCells($aR1, $aC1, $aR2, $aC2, $aHAlign = 'center', $aVAlign = 'center')
    {
        if ($aR1 > $aR2 || $aC1 > $aC2) {
            Util\JpGraphError::RaiseL(27004);
            //('GTextTable::MergeCells(). Specified cell range to be merged is not valid.');
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

Function doAutoScaleYAxis has a Cognitive Complexity of 14 (exceeds 5 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

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 SetScale has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function SetScale($aAxisType, $aYMin = 1, $aYMax = 1, $aXMin = 1, $aXMax = 1)
    {
        $this->axtype = $aAxisType;

        if ($aYMax < $aYMin || $aXMax < $aXMin) {
Severity: Minor
Found in src/graph/Graph.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 StrokeFrameBackground has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function StrokeFrameBackground()
    {
        if ($this->background_image != '' && $this->background_cflag != '') {
            Util\JpGraphError::RaiseL(25040); //('It is not possible to specify both a background image and a background country flag.');
        }
Severity: Minor
Found in src/graph/Graph.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 Add has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function Add($aPlot)
    {
        if ($aPlot == null) {
            Util\JpGraphError::RaiseL(25010); //("Graph::Add() You tried to add a null plot to the graph.");
        }
Severity: Minor
Found in src/graph/Graph.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 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function Stroke($img, $pos, $scale, $startangle)
    {
        $nbrpnts = safe_count($this->data);
        $astep   = 2 * M_PI / $nbrpnts;
        $a       = $startangle;
Severity: Minor
Found in src/graph/RadarGrid.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 Add has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
Open

    public function Add($aObject)
    {
        if (is_array($aObject) && safe_count($aObject) > 0) {
            $cl = $aObject[0];
            if (($cl instanceof Plot\IconPlot)) {
Severity: Minor
Found in src/graph/GanttGraph.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

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

    public function AdjPercentage($aData, $aPrec = 0)
    {
        $mul = 100;
        if ($aPrec > 0 && $aPrec < 3) {
            if ($aPrec == 1) {
Severity: Minor
Found in src/plot/PiePlot.php - About 1 hr to fix

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

        public function Convert($aTxt, $aFF)
        {
            if (LANGUAGE_GREEK) {
                if (GREEK_FROM_WINDOWS) {
                    $unistring = LanguageConv::gr_win2uni($aTxt);
    Severity: Minor
    Found in src/text/LanguageConv.php - About 1 hr to fix

      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

        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

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

                  public function SetImgFormat($aFormat, $aQuality = 75)
                  {
                      $this->quality = $aQuality;
                      $aFormat       = strtolower($aFormat);
                      $tst           = true;
              Severity: Minor
              Found in src/image/Image.php - About 1 hr to fix

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

                    public function StrokeCSIM($aScriptName = 'auto', $aCSIMName = '', $aBorder = 0)
                    {
                        if ($aCSIMName == '') {
                            // create a random map name
                            srand((int) (microtime() * 1000000));
                Severity: Minor
                Found in src/graph/Graph.php - About 1 hr to fix

                  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
                    Severity
                    Category
                    Status
                    Source
                    Language