HuasoFoundries/jpgraph

View on GitHub

Showing 6,805 of 6,805 total issues

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

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

    public function Linear(&$aData, $aIntFactor)
    {
        $step = pow(2, $aIntFactor - 1);

        $orig_cols = safe_count($aData[0]);
Severity: Minor
Found in src/plot/MeshInterpolate.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 MakeDirs has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function MakeDirs($aFile)
    {
        $dirs = [];
        // In order to better work when open_basedir is enabled
        // we do not create directories in the root path
Severity: Minor
Found in src/image/ImgStreamCache.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)
    {
        list($dx, $dy) = $this->isizespec[$this->iSize];
        $x             = $this->ix;
        $y             = $this->iy;
Severity: Minor
Found in src/image/LinkArrow.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 StrokeNumber has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function StrokeNumber($aValStr, $aColor = 0, $aFileName = '')
    {
        if ($aColor < 0 || $aColor >= safe_count($this->iColorSchema)) {
            $aColor = 0;
        }
Severity: Minor
Found in src/image/DigitalLED74.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 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 SetAlign has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function SetAlign($aR1HAlign = null, $aC1VAlign = null, $aR2 = null, $aC2 = null, $aHArg = null, $aVArg = 'center')
    {
        if ($aC1VAlign !== null && $aR2 !== null && $aC2 !== null && $aHArg !== null) {
            $this->_chkR($aR1HAlign);
            $this->_chkC($aC1VAlign);
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 '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 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 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 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 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 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 __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 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 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 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 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 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
          Severity
          Category
          Status
          Source
          Language