piotrpolak/pepiscms

View on GitHub
pepiscms/application/libraries/Google_chart_helper.php

Summary

Maintainability
C
1 day
Test Coverage

Method drawSimpleLineChart has 42 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function drawSimpleLineChart($data_feed, $collumn1_desc = '', $collumn2_desc = '', $width = 1200, $height = 200, $max_value = 10, $column1_data_type = "string", $column2_datatype = "number", $colors = array(), $type = 'number')
    {
        $id = $this->generateId('line_chart');

        $out = $this->includeJavaScripts();
Severity: Minor
Found in pepiscms/application/libraries/Google_chart_helper.php - About 1 hr to fix

    Method drawSimplePieChart has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function drawSimplePieChart($data_feed, $title = '', $width = 1200, $height = 200)
        {
            $id = $this->generateId('pie_chart');
    
            $out = $this->includeJavaScripts();
    Severity: Minor
    Found in pepiscms/application/libraries/Google_chart_helper.php - About 1 hr to fix

      Method drawSimpleLineChart has 10 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function drawSimpleLineChart($data_feed, $collumn1_desc = '', $collumn2_desc = '', $width = 1200, $height = 200, $max_value = 10, $column1_data_type = "string", $column2_datatype = "number", $colors = array(), $type = 'number')
      Severity: Major
      Found in pepiscms/application/libraries/Google_chart_helper.php - About 1 hr to fix

        Method drawSimpleColumnChart has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function drawSimpleColumnChart($data_feed, $collumn1_desc = '', $collumn2_desc = '', $width = 1200, $height = 200, $max_value = 10, $column1_data_type = "string", $column2_datatype = "number")
            {
                $id = $this->generateId('column_chart');
        
                $out = $this->includeJavaScripts();
        Severity: Minor
        Found in pepiscms/application/libraries/Google_chart_helper.php - About 1 hr to fix

          Function drawSimpleLineChart has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
          Open

              public function drawSimpleLineChart($data_feed, $collumn1_desc = '', $collumn2_desc = '', $width = 1200, $height = 200, $max_value = 10, $column1_data_type = "string", $column2_datatype = "number", $colors = array(), $type = 'number')
              {
                  $id = $this->generateId('line_chart');
          
                  $out = $this->includeJavaScripts();
          Severity: Minor
          Found in pepiscms/application/libraries/Google_chart_helper.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 drawSimpleColumnChart has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              public function drawSimpleColumnChart($data_feed, $collumn1_desc = '', $collumn2_desc = '', $width = 1200, $height = 200, $max_value = 10, $column1_data_type = "string", $column2_datatype = "number")
          Severity: Major
          Found in pepiscms/application/libraries/Google_chart_helper.php - About 1 hr to fix

            Function transformDataFeed has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                private function transformDataFeed($data_feed)
                {
                    $final_data_feed = array();
                    if (isset($data_feed[0]) && is_array($data_feed[0])) {
                        foreach ($data_feed[0] as $key => $value) {
            Severity: Minor
            Found in pepiscms/application/libraries/Google_chart_helper.php - About 45 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 drawSimpleColumnChart has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function drawSimpleColumnChart($data_feed, $collumn1_desc = '', $collumn2_desc = '', $width = 1200, $height = 200, $max_value = 10, $column1_data_type = "string", $column2_datatype = "number")
                {
                    $id = $this->generateId('column_chart');
            
                    $out = $this->includeJavaScripts();
            Severity: Minor
            Found in pepiscms/application/libraries/Google_chart_helper.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

            There are no issues that match your filters.

            Category
            Status