HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Method Color has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function Color($aColor)
    {
        if (is_string($aColor)) {
            $matches = [];
            // this regex will parse a color string and fill the $matches array as such:
Severity: Minor
Found in src/image/RGB.php - About 1 hr to fix

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

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

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

          public function FixupIndexes($aDataArray, $num)
          {
              $ret  = [];
              $keys = array_keys($aDataArray);
              foreach ($aDataArray as $idx => $data) {
      Severity: Minor
      Found in src/plot/WindrosePlot.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 Max has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function Max()
          {
              list($xmax) = $this->plots[0]->Max();
              $nmax       = 0;
              for ($i = 0; $i < safe_count($this->plots); ++$i) {
      Severity: Minor
      Found in src/plot/AccBarPlot.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 15 (exceeds 5 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

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

          public function StrokeFullSliceFrame($img, $xc, $yc, $sa, $ea, $w, $h, $z, $edgecolor, $exploderadius, $fulledge)
          {
              $step = 0.02;
      
              if ($exploderadius > 0) {
      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 Legend has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function Legend($graph)
          {
              if ($this->grad && $this->legend != '' && !$this->fill) {
                  $color = [$this->grad_fromcolor, $this->grad_tocolor];
                  // In order to differentiate between gradients and cooors specified as an Image\RGB triple
      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 StyleLine has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function StyleLine($x1, $y1, $x2, $y2, $aStyle = '', $from_grid_class = false)
          {
              if ($this->line_weight <= 0) {
                  return;
              }
      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 Stroke has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function Stroke($aImg, $x = null, $y = null)
          {
              if (is_numeric($x)) {
                  $this->x = round($x);
              }
      Severity: Minor
      Found in src/text/Text.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 AddText has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function AddText($aTxt, $aToY2 = false)
          {
              if ($aTxt == null) {
                  Util\JpGraphError::RaiseL(25014); //("Graph::AddText() You tried to add a null text 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 doPrestrokeAdjustments has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function doPrestrokeAdjustments()
          {
              // Do any pre-stroke adjustment that is needed by the different plot types
              // (i.e bar plots want's to add an offset to the x-labels etc)
              for ($i = 0; $i < safe_count($this->plots); ++$i) {
      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 AddBand has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function AddBand($aBand, $aToY2 = false)
          {
              if ($aBand == null) {
                  Util\JpGraphError::RaiseL(25016); //(" Graph::AddBand() You tried to add a null band 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 _doManualTickPos has a Cognitive Complexity of 15 (exceeds 5 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

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

          public static function GetURLArguments($aAddRecursiveBlocker = false)
          {
              if ($aAddRecursiveBlocker) {
                  // This is a JPGRAPH internal defined that prevents
                  // us from recursively coming here again
      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 GetXMinMax has a Cognitive Complexity of 15 (exceeds 5 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

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

          public function AddLine($aLine, $aToY2 = false)
          {
              if ($aLine == null) {
                  Util\JpGraphError::RaiseL(25015); //("Graph::AddLine() You tried to add a null line 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 StrokeFrame has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function StrokeFrame()
          {
              if (!$this->doframe) {
                  return;
              }
      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 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function Stroke($aStrokeFileName = '')
          {
              // If the filename is the predefined value = '_csim_special_'
              // we assume that the call to stroke only needs to do enough
              // to correctly generate the CSIM maps.
      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

      Function _StrokeAxisTitle has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          public function _StrokeAxisTitle($pos, $aAxisAngle, $title)
          {
              $this->title->Set($title);
              $marg = 6 + $this->title->margin;
              $xt   = round(($this->scale->world_abs_size + $marg) * cos($aAxisAngle) + $this->scale->scale_abs[0]);
      Severity: Minor
      Found in src/graph/RadarAxis.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