HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Function SetImage has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function SetImage($aFileR1, $aScaleC1 = null, $aMixR2 = null, $aC2 = null, $aFile = null, $aScale = 1.0, $aMix = 100)
    {
        if ($aScaleC1 !== null && $aMixR2 !== null && $aC2 !== null && $aFile !== null) {
            $this->_chkR($aArgR1);
            $this->_chkC($aC1);
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 ApplyPlot has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function ApplyPlot($plot)
    {
        switch (get_class($plot)) {
            case 'GroupBarPlot':
                    foreach ($plot->plots as $_plot) {
Severity: Minor
Found in src/themes/UniversalTheme.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 ApplyPlot has a Cognitive Complexity of 10 (exceeds 5 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

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

    public function AutoScale($aRadius, $aMinDist = 30)
    {
        if ($this->iManualScale) {
            return;
        }
Severity: Minor
Found in src/graph/WindrosePlotScale.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 GetLinesXMinMax has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function GetLinesXMinMax($aLines)
    {
        $n = safe_count($aLines);
        if ($n == 0) {
            return false;
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 IntCalcTicks has a Cognitive Complexity of 10 (exceeds 5 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

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

    public function __construct($aWidth = 300, $aHeight = 200, $aCachedName = '', $aTimeout = 0, $aInline = true)
    {
        $this->gDateLocale    = new Util\DateLocale();
        $this->gJpgDateLocale = new Util\DateLocale();
        if (!is_numeric($aWidth) || !is_numeric($aHeight)) {
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 SetTickDensity has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function SetTickDensity($aYDensity = TICKD_NORMAL, $aXDensity = TICKD_NORMAL)
    {
        $this->xtick_factor = 30;
        $this->ytick_factor = 25;
        switch ($aYDensity) {
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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function Stroke($aFileName = '')
    {
        // Find out the necessary size for the container image
        $w = 0;
        $h = 0;
Severity: Minor
Found in src/graph/MGraph.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 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function Stroke($aImg, $aScale)
    {
        if (!$this->iShow) {
            return;
        }
Severity: Minor
Found in src/graph/HorizontalGridLine.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 GetColArray has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function GetColArray($from_color, $to_color, $arr_size, &$colors, $numcols = 100)
    {
        if ($arr_size == 0) {
            return;
        }
Severity: Minor
Found in src/plot/Gradient.php - About 1 hr to fix

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

        public function Stroke($img, $xscale, $yscale)
        {
            // Remeber base color and size
            $bc  = $this->arrow->iColor;
            $bs  = $this->arrow->iSize;
    Severity: Minor
    Found in src/plot/FieldPlot.php - About 1 hr to fix

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

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

            public function Max()
            {
                if (isset($this->coords[1])) {
                    $x = $this->coords[1];
                } else {
        Severity: Minor
        Found in src/plot/Plot.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 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 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 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 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

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