HuasoFoundries/jpgraph

View on GitHub

Showing 706 of 6,805 total issues

Function GetNextColor has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function GetNextColor()
    {
        $color_list = $this->GetColorList();

        $color = null;
Severity: Minor
Found in src/themes/Theme.php - About 35 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 GetThemeColors has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function GetThemeColors($num = 30)
    {
        $result_list = [];

        $old_index         = $this->color_index;
Severity: Minor
Found in src/themes/Theme.php - About 35 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 CalcTicks has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function CalcTicks($maxsteps, $min, $max, $a, $b, $majend = true)
    {
        $diff = $max - $min;
        if ($diff == 0) {
            $ld = 0;
Severity: Minor
Found in src/graph/LinearScale.php - About 35 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 StrokeBackgroundGrad has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function StrokeBackgroundGrad()
    {
        if ($this->bkg_gradtype < 0) {
            return;
        }
Severity: Minor
Found in src/graph/Graph.php - About 35 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 gr_win2uni has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function gr_win2uni($winline)
    {
        $uniline = '';
        for ($i = 0; $i < strlen($winline); ++$i) {
            $thischar = substr($winline, $i, 1);
Severity: Minor
Found in src/text/LanguageConv.php - About 35 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 GetTicksFromMinMax has a Cognitive Complexity of 7 (exceeds 5 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 35 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 Add has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function Add($aObj)
    {
        if (is_array($aObj) && safe_count($aObj) > 0) {
            $cl = $aObj[0];
        } else {
Severity: Minor
Found in src/graph/WindroseGraph.php - About 35 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 Get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public static function Get($aSymb, $aCapital = false)
    {
        $iSymbols = [
            /* Greek */
            ['alpha', '03B1', '0391'],
Severity: Minor
Found in src/graph/SymChar.php - About 35 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 hasLinePlotAndBarPlot has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function hasLinePlotAndBarPlot()
    {
        $has_line = false;
        $has_bar  = false;

Severity: Minor
Found in src/graph/Graph.php - About 35 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 StrokeTexts has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function StrokeTexts()
    {
        // Stroke any user added text objects
        if ($this->texts != null) {
            for ($i = 0; $i < safe_count($this->texts); ++$i) {
Severity: Minor
Found in src/graph/Graph.php - About 35 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 GetMaxLabelHeight has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function GetMaxLabelHeight()
    {
        $m = 10;
        if ($this->iObj != null) {
            $n = safe_count($this->iObj);
Severity: Minor
Found in src/graph/GanttGraph.php - About 35 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 SetMinColWidth has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

    public function SetMinColWidth($aWidths)
    {
        $n = min(safe_count($this->iTitles), safe_count($aWidths));
        for ($i = 0; $i < $n; ++$i) {
            if (!empty($aWidths[$i])) {
Severity: Minor
Found in src/graph/GanttActivityInfo.php - About 35 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 Add has a Cognitive Complexity of 7 (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/RadarGraph.php - About 35 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

Avoid too many return statements within this method.
Open

        return [$sat, round($sat - $sat * ($aVal - 0.75) / $a), 0];
Severity: Major
Found in src/image/RGB.php - About 30 mins to fix

    Avoid too many return statements within this method.
    Open

                return;
    Severity: Major
    Found in src/image/Image.php - About 30 mins to fix

      Avoid too many return statements within this method.
      Open

              return true;
      Severity: Major
      Found in src/image/AntiSpam.php - About 30 mins to fix

        Avoid too many return statements within this method.
        Open

                    return LanguageConv::heb_iso2uni($aTxt);
        Severity: Major
        Found in src/text/LanguageConv.php - About 30 mins to fix

          Avoid too many return statements within this method.
          Open

                  return [$sat, round($sat - $sat * ($aVal - 0.75) / $a), 0];
          Severity: Major
          Found in src/util/RGB.php - About 30 mins to fix

            Avoid too many return statements within this method.
            Open

                        return $w;
            Severity: Major
            Found in src/text/TextProperty.php - About 30 mins to fix

              Avoid too many return statements within this method.
              Open

                      return $aTxt;
              Severity: Major
              Found in src/text/LanguageConv.php - About 30 mins to fix
                Severity
                Category
                Status
                Source
                Language