HuasoFoundries/jpgraph

View on GitHub
src/themes/AquaTheme.php

Summary

Maintainability
A
3 hrs
Test Coverage

Method ApplyPlot has 32 lines of code (exceeds 25 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/AquaTheme.php - About 1 hr to fix

    Method SetupGraph has 26 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function SetupGraph($graph)
        {
            // graph
            /*
            $img = $graph->img;
    Severity: Minor
    Found in src/themes/AquaTheme.php - About 1 hr to fix

      Function ApplyPlot has a Cognitive Complexity of 9 (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/AquaTheme.php - About 55 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

      Method name "AquaTheme::SetupPieGraph" is not in camel caps format
      Open

          public function SetupPieGraph($graph)
      Severity: Minor
      Found in src/themes/AquaTheme.php by phpcodesniffer

      Method name "AquaTheme::GetColorList" is not in camel caps format
      Open

          public function GetColorList()
      Severity: Minor
      Found in src/themes/AquaTheme.php by phpcodesniffer

      Method name "AquaTheme::ApplyPlot" is not in camel caps format
      Open

          public function ApplyPlot($plot)
      Severity: Minor
      Found in src/themes/AquaTheme.php by phpcodesniffer

      Method name "AquaTheme::SetupGraph" is not in camel caps format
      Open

          public function SetupGraph($graph)
      Severity: Minor
      Found in src/themes/AquaTheme.php by phpcodesniffer

      Method name "AquaTheme::PreStrokeApply" is not in camel caps format
      Open

          public function PreStrokeApply($graph)
      Severity: Minor
      Found in src/themes/AquaTheme.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          $this->ApplyPlot($_plot);
      Severity: Minor
      Found in src/themes/AquaTheme.php by phpcodesniffer

      Spaces must be used to indent lines; tabs are not allowed
      Open

                          $this->ApplyPlot($_plot);
      Severity: Minor
      Found in src/themes/AquaTheme.php by phpcodesniffer

      Line indented incorrectly; expected 16 spaces, found 20
      Open

                          foreach ($plot->plots as $_plot) {
      Severity: Minor
      Found in src/themes/AquaTheme.php by phpcodesniffer

      Line indented incorrectly; expected 16 spaces, found 20
      Open

                          }
      Severity: Minor
      Found in src/themes/AquaTheme.php by phpcodesniffer

      Line indented incorrectly; expected 16 spaces, found 20
      Open

                          foreach ($plot->plots as $_plot) {
      Severity: Minor
      Found in src/themes/AquaTheme.php by phpcodesniffer

      Line indented incorrectly; expected 16 spaces, found 20
      Open

                          }
      Severity: Minor
      Found in src/themes/AquaTheme.php by phpcodesniffer

      There are no issues that match your filters.

      Category
      Status