HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Avoid too many return statements within this method.
Open

            return mb_convert_encoding($aTxt, 'UTF-8', 'EUC-JP');
Severity: Major
Found in src/text/LanguageConv.php - About 30 mins to fix

    Function Stroke has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function Stroke($img, $xscale, $yscale)
        {
            if (safe_count($this->manualIsobarColors) > 0) {
                $this->contourColor = $this->manualIsobarColors;
                if (safe_count($this->manualIsobarColors) != $this->nbrContours) {
    Severity: Minor
    Found in src/plot/ContourPlot.php - About 25 mins 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 getHeight has a Cognitive Complexity of 6 (exceeds 5 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 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function __construct($aPos, $aLabel, $aStart, $aEnd, $aCaption = '', $aHeightFactor = 0.6)
        {
            parent::__construct();
            $this->iStart = $aStart;
            // Is the end date given as a date or as number of days added to start date?
    Severity: Minor
    Found in src/plot/GanttBar.php - About 25 mins 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 AddCSIMPoly has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function AddCSIMPoly($aPts)
        {
            $coords = round($aPts[0]) . ', ' . round($aPts[1]);
            $n      = safe_count($aPts) / 2;
            for ($i = 1; $i < $n; ++$i) {
    Severity: Minor
    Found in src/plot/PlotMark.php - About 25 mins 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 resetEdgeMatrices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function resetEdgeMatrices()
        {
            for ($k = 0; $k < 2; ++$k) {
                for ($i = 0; $i <= $this->nbrRows; ++$i) {
                    for ($j = 0; $j <= $this->nbrCols; ++$j) {
    Severity: Minor
    Found in src/plot/Contour.php - About 25 mins 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 getWidth has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function getWidth($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 25 mins 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 CreateRawCanvas has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function CreateRawCanvas($aWidth = 0, $aHeight = 0)
        {
            $aWidth *= SUPERSAMPLING_SCALE;
            $aHeight *= SUPERSAMPLING_SCALE;
    
    
    Severity: Minor
    Found in src/image/Image.php - About 25 mins 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 DrawLine has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function DrawLine($im, $x1, $y1, $x2, $y2, $weight, $color)
        {
            if ($weight == 1) {
                return imageline($im, $x1, $y1, $x2, $y2, $color);
            }
    Severity: Minor
    Found in src/image/Image.php - About 25 mins 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 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function Legend($graph)
        {
            if ($this->legend != '') {
                if ($this->filled && !$this->fillgrad) {
                    $graph->legend->Add(
    Severity: Minor
    Found in src/plot/LinePlot.php - About 25 mins 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 CakeSlice has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function CakeSlice($xc, $yc, $w, $h, $s, $e, $fillcolor = '', $arccolor = '')
        {
            $s  = round($s);
            $e  = round($e);
            $w  = round($w);
    Severity: Minor
    Found in src/image/Image.php - About 25 mins 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 SetPadding has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function SetPadding($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aPad = null)
        {
            if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aPad !== null) {
                $this->_chkR($aArgR1);
                $this->_chkC($aC1);
    Severity: Minor
    Found in src/text/GTextTable.php - About 25 mins 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 SetColor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function SetColor($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aArg = null)
        {
            if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aArg !== null) {
                $this->_chkR($aArgR1);
                $this->_chkC($aC1);
    Severity: Minor
    Found in src/text/GTextTable.php - About 25 mins 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 Calc has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function Calc()
        {
            $this->icalculated = true;
    
            $n   = safe_count($this->ix);
    Severity: Minor
    Found in src/util/LinearRegression.php - About 25 mins 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 toString has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function toString()
        {
            $t = '<table border=1 cellspacing=0 cellpadding=0>';
            for ($i = 0; $i < $this->iSize[0]; ++$i) {
                $t .= '<tr>';
    Severity: Minor
    Found in src/text/GTextTable.php - About 25 mins 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 NormalizeDate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function NormalizeDate($aDate)
        {
            if ($aDate === false) {
                return false;
            }
    Severity: Minor
    Found in src/graph/GanttScale.php - About 25 mins 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 StrokePlotArea has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function StrokePlotArea()
        {
            // Note: To be consistent we really should take a possible shadow
            // into account. However, that causes some problem for the LinearScale class
            // since in the current design it does not have any links to class Graph which
    Severity: Minor
    Found in src/graph/Graph.php - About 25 mins 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 GetHeaderHeight has a Cognitive Complexity of 6 (exceeds 5 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 25 mins 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 SetTextOrientation has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function SetTextOrientation($aArgR1, $aC1 = null, $aR2 = null, $aC2 = null, $aO = null)
        {
            if ($aC1 !== null && $aR2 !== null && $aC2 !== null && $aPad !== null) {
                $this->_chkR($aArgR1);
                $this->_chkC($aC1);
    Severity: Minor
    Found in src/text/GTextTable.php - About 25 mins 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 InitConstants has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
    Open

        public function InitConstants($img)
        {
            if ($this->type == 'x') {
                $this->world_abs_size = $img->width - $img->left_margin - $img->right_margin;
                $this->off            = $img->left_margin;
    Severity: Minor
    Found in src/graph/LinearScale.php - About 25 mins 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