ampache/ampache

View on GitHub
src/Module/Util/Graph.php

Summary

Maintainability
F
4 days
Test Coverage

The class Graph has an overall complexity of 79 which is very high. The configured complexity threshold is 50.
Open

class Graph
{
    public function __construct()
    {
        if (AmpConfig::get('statistical_graphs') && is_dir(__DIR__ . '/../../../vendor/szymach/c-pchart/src/Chart/')) {
Severity: Minor
Found in src/Module/Util/Graph.php by phpmd

File Graph.php has 535 lines of code (exceeds 500 allowed). Consider refactoring.
Open

<?php

declare(strict_types=1);

/**
Severity: Major
Found in src/Module/Util/Graph.php - About 2 hrs to fix

    Graph has 25 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class Graph
    {
        public function __construct()
        {
            if (AmpConfig::get('statistical_graphs') && is_dir(__DIR__ . '/../../../vendor/szymach/c-pchart/src/Chart/')) {
    Severity: Minor
    Found in src/Module/Util/Graph.php - About 2 hrs to fix

      Function get_catalog_all_pts has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function get_catalog_all_pts(
              $fct,
              Data $MyData,
              $catalog_id = 0,
              $object_type = null,
      Severity: Minor
      Found in src/Module/Util/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 get_user_all_pts has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
      Open

          protected function get_user_all_pts(
              $fct,
              Data $MyData,
              $user_id = 0,
              $object_type = null,
      Severity: Minor
      Found in src/Module/Util/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

      Method get_all_pts has 9 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              $fct,
              Data $MyData,
              $user_id = 0,
              $object_type = null,
              $object_id = 0,
      Severity: Major
      Found in src/Module/Util/Graph.php - About 1 hr to fix

        Method get_user_all_pts has 8 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $fct,
                Data $MyData,
                $user_id = 0,
                $object_type = null,
                $object_id = 0,
        Severity: Major
        Found in src/Module/Util/Graph.php - About 1 hr to fix

          Method render_catalog_size has 8 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  $catalog_id = 0,
                  $object_type = null,
                  $object_id = 0,
                  $start_date = null,
                  $end_date = null,
          Severity: Major
          Found in src/Module/Util/Graph.php - About 1 hr to fix

            Method get_catalog_all_pts has 8 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                    $fct,
                    Data $MyData,
                    $catalog_id = 0,
                    $object_type = null,
                    $object_id = 0,
            Severity: Major
            Found in src/Module/Util/Graph.php - About 1 hr to fix

              Method render_user_hits has 8 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                      $user_id,
                      $object_type,
                      $object_id,
                      $start_date = null,
                      $end_date = null,
              Severity: Major
              Found in src/Module/Util/Graph.php - About 1 hr to fix

                Method render_user_bandwidth has 8 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        $user_id = 0,
                        $object_type = null,
                        $object_id = 0,
                        $start_date = null,
                        $end_date = null,
                Severity: Major
                Found in src/Module/Util/Graph.php - About 1 hr to fix

                  Method render_catalog_files has 8 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          $catalog_id = 0,
                          $object_type = null,
                          $object_id = 0,
                          $start_date = null,
                          $end_date = null,
                  Severity: Major
                  Found in src/Module/Util/Graph.php - About 1 hr to fix

                    Method get_user_object_count_pts has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            $user_id = 0,
                            $object_type = 'song',
                            $object_id = 0,
                            $start_date = null,
                            $end_date = null,
                    Severity: Major
                    Found in src/Module/Util/Graph.php - About 50 mins to fix

                      Method get_all_type_pts has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              $fct,
                              $id = 0,
                              $object_type = null,
                              $object_id = 0,
                              $start_date = null,
                      Severity: Major
                      Found in src/Module/Util/Graph.php - About 50 mins to fix

                        Method get_catalog_files_pts has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                $catalog_id = 0,
                                $object_type = 'song',
                                $object_id = 0,
                                $start_date = null,
                                $end_date = null,
                        Severity: Minor
                        Found in src/Module/Util/Graph.php - About 45 mins to fix

                          Method get_catalog_size_pts has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                                  $catalog_id = 0,
                                  $object_type = 'song',
                                  $object_id = 0,
                                  $start_date = null,
                                  $end_date = null,
                          Severity: Minor
                          Found in src/Module/Util/Graph.php - About 45 mins to fix

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

                                public function display_map(
                                    $user_id = 0,
                                    $object_type = null,
                                    $object_id = 0,
                                    $start_date = null,
                            Severity: Minor
                            Found in src/Module/Util/Graph.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

                            Method get_user_hits_pts has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    $user_id = 0,
                                    $object_type = 'song',
                                    $object_id = 0,
                                    $start_date = null,
                                    $end_date = null,
                            Severity: Minor
                            Found in src/Module/Util/Graph.php - About 45 mins to fix

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

                                  protected function render_graph($title, Data $MyData, $zoom, $width = 0, $height = 0)
                                  {
                                      // Check graph size sanity
                                      $width = (int)$width;
                                      if ($width <= 50 || $width > 4096) {
                              Severity: Minor
                              Found in src/Module/Util/Graph.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

                              Method get_user_bandwidth_pts has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                  protected function get_user_bandwidth_pts($user_id = 0, $object_type = 'song', $object_id = 0, $start_date = null, $end_date = null, $zoom = 'day'): array
                              Severity: Minor
                              Found in src/Module/Util/Graph.php - About 45 mins to fix

                                Method get_geolocation_pts has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                Open

                                        $user_id = 0,
                                        $object_type = '',
                                        $object_id = 0,
                                        $start_date = null,
                                        $end_date = null,
                                Severity: Minor
                                Found in src/Module/Util/Graph.php - About 45 mins to fix

                                  Method get_user_time_pts has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                  Open

                                          $user_id = 0,
                                          $object_type = 'song',
                                          $object_id = 0,
                                          $start_date = null,
                                          $end_date = null,
                                  Severity: Minor
                                  Found in src/Module/Util/Graph.php - About 45 mins to fix

                                    Method display_map has 6 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                            $user_id = 0,
                                            $object_type = null,
                                            $object_id = 0,
                                            $start_date = null,
                                            $end_date = null,
                                    Severity: Minor
                                    Found in src/Module/Util/Graph.php - About 45 mins to fix

                                      Method get_catalog_sql_where has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                              $object_type = 'song',
                                              $object_id = 0,
                                              $catalog_id = 0,
                                              $start_date = null,
                                              $end_date = null
                                      Severity: Minor
                                      Found in src/Module/Util/Graph.php - About 35 mins to fix

                                        Method get_user_sql_where has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                                $user_id = 0,
                                                $object_type = null,
                                                $object_id = 0,
                                                $start_date = null,
                                                $end_date = null
                                        Severity: Minor
                                        Found in src/Module/Util/Graph.php - About 35 mins to fix

                                          Method render_graph has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                          Open

                                              protected function render_graph($title, Data $MyData, $zoom, $width = 0, $height = 0)
                                          Severity: Minor
                                          Found in src/Module/Util/Graph.php - About 35 mins to fix

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

                                                protected function get_all_type_pts(
                                                    $fct,
                                                    $id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                            Severity: Minor
                                            Found in src/Module/Util/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 get_user_sql_where has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                            Open

                                                protected function get_user_sql_where(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/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

                                            This function has 8 parameters, which is greater than the 7 authorized.
                                            Open

                                                public function render_catalog_files(
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Major
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                                            Noncompliant Code Example

                                            With a maximum number of 4 parameters:

                                            function doSomething($param1, $param2, $param3, $param4, $param5) {
                                            ...
                                            }
                                            

                                            Compliant Solution

                                            function doSomething($param1, $param2, $param3, $param4) {
                                            ...
                                            }
                                            

                                            This function has 8 parameters, which is greater than the 7 authorized.
                                            Open

                                                protected function get_catalog_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                            Severity: Major
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                                            Noncompliant Code Example

                                            With a maximum number of 4 parameters:

                                            function doSomething($param1, $param2, $param3, $param4, $param5) {
                                            ...
                                            }
                                            

                                            Compliant Solution

                                            function doSomething($param1, $param2, $param3, $param4) {
                                            ...
                                            }
                                            

                                            This function has 8 parameters, which is greater than the 7 authorized.
                                            Open

                                                protected function get_user_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Major
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                                            Noncompliant Code Example

                                            With a maximum number of 4 parameters:

                                            function doSomething($param1, $param2, $param3, $param4, $param5) {
                                            ...
                                            }
                                            

                                            Compliant Solution

                                            function doSomething($param1, $param2, $param3, $param4) {
                                            ...
                                            }
                                            

                                            This function has 8 parameters, which is greater than the 7 authorized.
                                            Open

                                                public function render_catalog_size(
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Major
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                                            Noncompliant Code Example

                                            With a maximum number of 4 parameters:

                                            function doSomething($param1, $param2, $param3, $param4, $param5) {
                                            ...
                                            }
                                            

                                            Compliant Solution

                                            function doSomething($param1, $param2, $param3, $param4) {
                                            ...
                                            }
                                            

                                            Class "Graph" has 25 methods, which is greater than 20 authorized. Split it into smaller classes.
                                            Open

                                            class Graph
                                            Severity: Major
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            A class that grows too much tends to aggregate too many responsibilities and inevitably becomes harder to understand and therefore to maintain. Above a specific threshold, it is strongly advised to refactor the class into smaller ones which focus on well defined topics.

                                            This function has 8 parameters, which is greater than the 7 authorized.
                                            Open

                                                public function render_user_bandwidth(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Major
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                                            Noncompliant Code Example

                                            With a maximum number of 4 parameters:

                                            function doSomething($param1, $param2, $param3, $param4, $param5) {
                                            ...
                                            }
                                            

                                            Compliant Solution

                                            function doSomething($param1, $param2, $param3, $param4) {
                                            ...
                                            }
                                            

                                            This function has 9 parameters, which is greater than the 7 authorized.
                                            Open

                                                protected function get_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Major
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                                            Noncompliant Code Example

                                            With a maximum number of 4 parameters:

                                            function doSomething($param1, $param2, $param3, $param4, $param5) {
                                            ...
                                            }
                                            

                                            Compliant Solution

                                            function doSomething($param1, $param2, $param3, $param4) {
                                            ...
                                            }
                                            

                                            This function has 8 parameters, which is greater than the 7 authorized.
                                            Open

                                                public function render_user_hits(
                                                    $user_id,
                                                    $object_type,
                                                    $object_id,
                                                    $start_date = null,
                                            Severity: Major
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            A long parameter list can indicate that a new structure should be created to wrap the numerous parameters or that the function is doing too many things.

                                            Noncompliant Code Example

                                            With a maximum number of 4 parameters:

                                            function doSomething($param1, $param2, $param3, $param4, $param5) {
                                            ...
                                            }
                                            

                                            Compliant Solution

                                            function doSomething($param1, $param2, $param3, $param4) {
                                            ...
                                            }
                                            

                                            The method get_all_type_pts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                            Open

                                                        } else {
                                                            $values[$date] = $value;
                                                        }
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            ElseExpression

                                            Since: 1.4.0

                                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                            Example

                                            class Foo
                                            {
                                                public function bar($flag)
                                                {
                                                    if ($flag) {
                                                        // one branch
                                                    } else {
                                                        // another branch
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                                            The method get_catalog_all_pts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                            Open

                                                                } else {
                                                                    $value = 0;
                                                                }
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            ElseExpression

                                            Since: 1.4.0

                                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                            Example

                                            class Foo
                                            {
                                                public function bar($flag)
                                                {
                                                    if ($flag) {
                                                        // one branch
                                                    } else {
                                                        // another branch
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                                            The method get_user_all_pts uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
                                            Open

                                                                } else {
                                                                    $value = 0;
                                                                }
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            ElseExpression

                                            Since: 1.4.0

                                            An if expression with an else branch is basically not necessary. You can rewrite the conditions in a way that the else clause is not necessary and the code becomes simpler to read. To achieve this, use early return statements, though you may need to split the code it several smaller methods. For very simple assignments you could also use the ternary operations.

                                            Example

                                            class Foo
                                            {
                                                public function bar($flag)
                                                {
                                                    if ($flag) {
                                                        // one branch
                                                    } else {
                                                        // another branch
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/cleancode.html#elseexpression

                                            Define a constant instead of duplicating this literal "month" 5 times.
                                            Open

                                                        case 'month':
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                                            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                                            Noncompliant Code Example

                                            With the default threshold of 3:

                                            function run() {
                                              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                                              execute('action1');
                                              release('action1');
                                            }
                                            

                                            Compliant Solution

                                            ACTION_1 = 'action1';
                                            
                                            function run() {
                                              prepare(ACTION_1);
                                              execute(ACTION_1);
                                              release(ACTION_1);
                                            }
                                            

                                            Exceptions

                                            To prevent generating some false-positives, literals having less than 5 characters are excluded.

                                            Define a constant instead of duplicating this literal "DATE_FORMAT(FROM_UNIXTIME(" 4 times.
                                            Open

                                                            $dateformat = "DATE_FORMAT(FROM_UNIXTIME(" . $field . "), '%Y-%m-%d %H:00:00')";
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                                            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                                            Noncompliant Code Example

                                            With the default threshold of 3:

                                            function run() {
                                              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                                              execute('action1');
                                              release('action1');
                                            }
                                            

                                            Compliant Solution

                                            ACTION_1 = 'action1';
                                            
                                            function run() {
                                              prepare(ACTION_1);
                                              execute(ACTION_1);
                                              release(ACTION_1);
                                            }
                                            

                                            Exceptions

                                            To prevent generating some false-positives, literals having less than 5 characters are excluded.

                                            Remove the unused function parameter "$zoom".
                                            Open

                                                    $zoom = 'day'
                                            Severity: Major
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            Unused parameters are misleading. Whatever the value passed to such parameters is, the behavior will be the same.

                                            Noncompliant Code Example

                                            function doSomething($a, $b) { // "$a" is unused
                                              return compute($b);
                                            }
                                            

                                            Compliant Solution

                                            function doSomething($b) {
                                              return compute($b);
                                            }
                                            

                                            Exceptions

                                            Functions in classes that override a class or implement interfaces are ignored.

                                            class C extends B {
                                            
                                              function doSomething($a, $b) {     // no issue reported on $b
                                                compute($a);
                                              }
                                            
                                            }
                                            

                                            See

                                            • MISRA C++:2008, 0-1-11 - There shall be no unused parameters (named or unnamed) in nonvirtual functions.
                                            • MISRA C:2012, 2.7 - There should be no unused parameters in functions
                                            • CERT, MSC12-C. - Detect and remove code that has no effect or is never executed
                                            • CERT, MSC12-CPP. - Detect and remove code that has no effect

                                            Define a constant instead of duplicating this literal "zoom_date" 4 times.
                                            Open

                                                        $values[$results['zoom_date']] = $results['hits'];
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                                            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                                            Noncompliant Code Example

                                            With the default threshold of 3:

                                            function run() {
                                              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                                              execute('action1');
                                              release('action1');
                                            }
                                            

                                            Compliant Solution

                                            ACTION_1 = 'action1';
                                            
                                            function run() {
                                              prepare(ACTION_1);
                                              execute(ACTION_1);
                                              release(ACTION_1);
                                            }
                                            

                                            Exceptions

                                            To prevent generating some false-positives, literals having less than 5 characters are excluded.

                                            Merge this if statement with the enclosing one.
                                            Open

                                                            if ($plugin->_plugin->display_map($pts)) {
                                            Severity: Major
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            Merging collapsible if statements increases the code's readability.

                                            Noncompliant Code Example

                                            if (condition1) {
                                              if (condition2) {
                                                ...
                                              }
                                            }
                                            

                                            Compliant Solution

                                            if (condition1 && condition2) {
                                              ...
                                            }
                                            

                                            Define a constant instead of duplicating this literal "SELECT " 5 times.
                                            Open

                                                    $sql        = "SELECT " . $dateformat . " AS `zoom_date`, COUNT(`object_count`.`id`) AS `hits` FROM `object_count` " . $where . " GROUP BY " . $dateformat;
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                                            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                                            Noncompliant Code Example

                                            With the default threshold of 3:

                                            function run() {
                                              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                                              execute('action1');
                                              release('action1');
                                            }
                                            

                                            Compliant Solution

                                            ACTION_1 = 'action1';
                                            
                                            function run() {
                                              prepare(ACTION_1);
                                              execute(ACTION_1);
                                              release(ACTION_1);
                                            }
                                            

                                            Exceptions

                                            To prevent generating some false-positives, literals having less than 5 characters are excluded.

                                            Add a "case default" clause to this "switch" statement.
                                            Open

                                                    switch ($zoom) {
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            The requirement for a final case default clause is defensive programming. The clause should either take appropriate action, or contain a suitable comment as to why no action is taken. Even when the switch covers all current values of an enum, a default case should still be used because there is no guarantee that the enum won't be extended.

                                            Noncompliant Code Example

                                            switch ($param) {  //missing default clause
                                              case 0:
                                                do_something();
                                                break;
                                              case 1:
                                                do_something_else();
                                                break;
                                            }
                                            
                                            switch ($param) {
                                              default: // default clause should be the last one
                                                error();
                                                break;
                                              case 0:
                                                do_something();
                                                break;
                                              case 1:
                                                do_something_else();
                                                break;
                                            }
                                            

                                            Compliant Solution

                                            switch ($param) {
                                              case 0:
                                                do_something();
                                                break;
                                              case 1:
                                                do_something_else();
                                                break;
                                              default:
                                                error();
                                                break;
                                            }
                                            

                                            See

                                            • MISRA C:2004, 15.0 - The MISRA C switch syntax shall be used.
                                            • MISRA C:2004, 15.3 - The final clause of a switch statement shall be the default clause
                                            • MISRA C++:2008, 6-4-3 - A switch statement shall be a well-formed switch statement.
                                            • MISRA C++:2008, 6-4-6 - The final clause of a switch statement shall be the default-clause
                                            • MISRA C:2012, 16.1 - All switch statements shall be well-formed
                                            • MISRA C:2012, 16.4 - Every switch statement shall have a default label
                                            • MISRA C:2012, 16.5 - A default label shall appear as either the first or the last switch label of a switch statement
                                            • MITRE, CWE-478 - Missing Default Case in Switch Statement
                                            • CERT, MSC01-C. - Strive for logical completeness
                                            • CERT, MSC01-CPP. - Strive for logical completeness

                                            Define a constant instead of duplicating this literal " GROUP BY " 5 times.
                                            Open

                                                    $sql        = "SELECT " . $dateformat . " AS `zoom_date`, COUNT(`object_count`.`id`) AS `hits` FROM `object_count` " . $where . " GROUP BY " . $dateformat;
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                                            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                                            Noncompliant Code Example

                                            With the default threshold of 3:

                                            function run() {
                                              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                                              execute('action1');
                                              release('action1');
                                            }
                                            

                                            Compliant Solution

                                            ACTION_1 = 'action1';
                                            
                                            function run() {
                                              prepare(ACTION_1);
                                              execute(ACTION_1);
                                              release(ACTION_1);
                                            }
                                            

                                            Exceptions

                                            To prevent generating some false-positives, literals having less than 5 characters are excluded.

                                            Define a constant instead of duplicating this literal " AND `" 3 times.
                                            Open

                                                    $sql = "WHERE `" . $object_type . "`.`addition_time` >= " . $start_date . " AND `" . $object_type . "`.`addition_time` <= " . $end_date;
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                                            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                                            Noncompliant Code Example

                                            With the default threshold of 3:

                                            function run() {
                                              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                                              execute('action1');
                                              release('action1');
                                            }
                                            

                                            Compliant Solution

                                            ACTION_1 = 'action1';
                                            
                                            function run() {
                                              prepare(ACTION_1);
                                              execute(ACTION_1);
                                              release(ACTION_1);
                                            }
                                            

                                            Exceptions

                                            To prevent generating some false-positives, literals having less than 5 characters are excluded.

                                            Define a constant instead of duplicating this literal "FontSize" 3 times.
                                            Open

                                                    $myPicture->setFontProperties(array("FontName" => "Forgotte.ttf", "FontSize" => 11));
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                                            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                                            Noncompliant Code Example

                                            With the default threshold of 3:

                                            function run() {
                                              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                                              execute('action1');
                                              release('action1');
                                            }
                                            

                                            Compliant Solution

                                            ACTION_1 = 'action1';
                                            
                                            function run() {
                                              prepare(ACTION_1);
                                              execute(ACTION_1);
                                              release(ACTION_1);
                                            }
                                            

                                            Exceptions

                                            To prevent generating some false-positives, literals having less than 5 characters are excluded.

                                            Define a constant instead of duplicating this literal "TimeStamp" 3 times.
                                            Open

                                                        $MyData->addPoints($date, "TimeStamp");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by sonar-php

                                            Duplicated string literals make the process of refactoring error-prone, since you must be sure to update all occurrences.

                                            On the other hand, constants can be referenced from many places, but only need to be updated in a single place.

                                            Noncompliant Code Example

                                            With the default threshold of 3:

                                            function run() {
                                              prepare('action1');                              // Non-Compliant - 'action1' is duplicated 3 times
                                              execute('action1');
                                              release('action1');
                                            }
                                            

                                            Compliant Solution

                                            ACTION_1 = 'action1';
                                            
                                            function run() {
                                              prepare(ACTION_1);
                                              execute(ACTION_1);
                                              release(ACTION_1);
                                            }
                                            

                                            Exceptions

                                            To prevent generating some false-positives, literals having less than 5 characters are excluded.

                                            Avoid unused parameters such as '$zoom'.
                                            Open

                                                    $zoom = 'day'
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            UnusedFormalParameter

                                            Since: 0.2

                                            Avoid passing parameters to methods or constructors and then not using those parameters.

                                            Example

                                            class Foo
                                            {
                                                private function bar($howdy)
                                                {
                                                    // $howdy is not used
                                                }
                                            }

                                            Source https://phpmd.org/rules/unusedcode.html#unusedformalparameter

                                            Avoid unused local variables such as '$date'.
                                            Open

                                                    foreach ($values as $date => $value) {
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            UnusedLocalVariable

                                            Since: 0.2

                                            Detects when a local variable is declared and/or assigned, but not used.

                                            Example

                                            class Foo {
                                                public function doSomething()
                                                {
                                                    $i = 5; // Unused
                                                }
                                            }

                                            Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                                            Avoid unused local variables such as '$date'.
                                            Open

                                                    foreach ($values as $date => $value) {
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            UnusedLocalVariable

                                            Since: 0.2

                                            Detects when a local variable is declared and/or assigned, but not used.

                                            Example

                                            class Foo {
                                                public function doSomething()
                                                {
                                                    $i = 5; // Unused
                                                }
                                            }

                                            Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                                            Avoid unused local variables such as '$date'.
                                            Open

                                                    foreach ($values as $date => $value) {
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            UnusedLocalVariable

                                            Since: 0.2

                                            Detects when a local variable is declared and/or assigned, but not used.

                                            Example

                                            class Foo {
                                                public function doSomething()
                                                {
                                                    $i = 5; // Unused
                                                }
                                            }

                                            Source https://phpmd.org/rules/unusedcode.html#unusedlocalvariable

                                            Call to method addPoints from undeclared class \CpChart\Data
                                            Open

                                                            $MyData->addPoints($value, "Total");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \AXIS_FORMAT_DATE
                                            Open

                                                            $MyData->setXAxisDisplay(AXIS_FORMAT_DATE, "Y-m-d");
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setShadow from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->setShadow(true, array("X" => 1, "Y" => 1, "R" => 0, "G" => 0, "B" => 0, "Alpha" => 10));
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Argument 3 (object_type) is null but \Ampache\Module\Util\Graph::get_all_type_pts() takes string defined at /code/src/Module/Util/Graph.php:160
                                            Open

                                                    $values = $this->get_all_type_pts('get_user_time_pts', $user_id, null, 0, $start_date, $end_date, 'month');
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to deprecated function \Ampache\Module\Util\Graph::getUserRepository() defined at /code/src/Module/Util/Graph.php:847
                                            Open

                                                    $userRepository = $this->getUserRepository();
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method drawLegend from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->drawLegend(280, 20, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method __construct from undeclared class \CpChart\Data
                                            Open

                                                    $MyData = new Data();
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setAxisDisplay from undeclared class \CpChart\Data
                                            Open

                                                    $MyData->setAxisDisplay(0, AXIS_FORMAT_TRAFFIC);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method addPoints from undeclared class \CpChart\Data
                                            Open

                                                        $MyData->addPoints($date, "TimeStamp");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method addPoints from undeclared class \CpChart\Data
                                            Open

                                                                $MyData->addPoints($value, $userName);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setAbscissa from undeclared class \CpChart\Data
                                            Open

                                                    $MyData->setAbscissa("TimeStamp");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method __construct from undeclared class \CpChart\image
                                            Open

                                                    $myPicture = new CpChart\Image($width, $height, $MyData);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Found a return statement with a value in the implementation of the magic method \Ampache\Module\Util\Graph::__construct, expected void return type
                                            Open

                                                public function __construct()
                                            Severity: Info
                                            Found in src/Module/Util/Graph.php by phan

                                            Parameter $MyData has undeclared type \CpChart\Data
                                            Open

                                                protected function get_all_pts(
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setFontProperties from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->setFontProperties(array("FontName" => "pf_arma_five.ttf", "FontSize" => 6));
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \AXIS_FORMAT_DATE
                                            Open

                                                            $MyData->setXAxisDisplay(AXIS_FORMAT_DATE, "Y");
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setGraphArea from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->setGraphArea(60, 40, $width - 20, $height - 50);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setAxisName from undeclared class \CpChart\Data
                                            Open

                                                    $MyData->setAxisName(0, "Hits");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method read from undeclared class \Ampache\Module\System\Dba
                                            Open

                                                    $db_results = Dba::read($sql);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \AXIS_FORMAT_TIME
                                            Open

                                                            $MyData->setXAxisDisplay(AXIS_FORMAT_TIME, "H:00");
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setFontProperties from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->setFontProperties(array("FontName" => "Forgotte.ttf", "FontSize" => 11));
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method __construct from undeclared class \CpChart\Data
                                            Open

                                                    $MyData = new Data();
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Parameter $MyData has undeclared type \CpChart\Data
                                            Open

                                                protected function get_catalog_all_pts(
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method addPoints from undeclared class \CpChart\Data
                                            Open

                                                                $MyData->addPoints($value, (string)$catalog->name);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method read from undeclared class \Ampache\Module\System\Dba
                                            Open

                                                    $db_results = Dba::read($sql);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method read from undeclared class \Ampache\Module\System\Dba
                                            Open

                                                    $db_results = Dba::read($sql);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Parameter $MyData has undeclared type \CpChart\Data
                                            Open

                                                protected function render_graph($title, Data $MyData, $zoom, $width = 0, $height = 0)
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \AXIS_FORMAT_DATE
                                            Open

                                                            $MyData->setXAxisDisplay(AXIS_FORMAT_DATE, "Y-m");
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method drawFilledRectangle from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->drawFilledRectangle(0, 0, $width, $height, $Settings);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to instance property Antialias from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->Antialias = true;
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \LEGEND_NOBORDER
                                            Open

                                                    $myPicture->drawLegend(280, 20, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Argument 3 (object_type) is null but \Ampache\Module\Util\Graph::get_all_type_pts() takes string defined at /code/src/Module/Util/Graph.php:160
                                            Open

                                                    $values = $this->get_all_type_pts('get_user_bandwidth_pts', $user_id, null, 0, $start_date, $end_date, 'month');
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setSerieDescription from undeclared class \CpChart\Data
                                            Open

                                                    $MyData->setSerieDescription("TimeStamp", "time");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setXAxisDisplay from undeclared class \CpChart\Data
                                            Open

                                                            $MyData->setXAxisDisplay(AXIS_FORMAT_DATE, "Y-m");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method drawGradientArea from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->drawGradientArea(0, 0, $width, $height, DIRECTION_VERTICAL, $Settings);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \SCALE_MODE_START0
                                            Open

                                                        "Mode" => SCALE_MODE_START0,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \AXIS_FORMAT_METRIC
                                            Open

                                                    $MyData->setAxisDisplay(0, AXIS_FORMAT_METRIC);
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setAxisName from undeclared class \CpChart\Data
                                            Open

                                                    $MyData->setAxisName(0, "Bandwidth");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to instance property Antialias from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->Antialias = false;
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method drawLineChart from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->drawLineChart();
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \AXIS_FORMAT_TRAFFIC
                                            Open

                                                    $MyData->setAxisDisplay(0, AXIS_FORMAT_TRAFFIC);
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method read from undeclared class \Ampache\Module\System\Dba
                                            Open

                                                    $db_results = Dba::read($sql);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method fetch_assoc from undeclared class \Ampache\Module\System\Dba
                                            Open

                                                    while ($results = Dba::fetch_assoc($db_results)) {
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setXAxisDisplay from undeclared class \CpChart\Data
                                            Open

                                                            $MyData->setXAxisDisplay(AXIS_FORMAT_TIME, "H:00");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \LABELING_DIFFERENT
                                            Open

                                                        "LabelingMethod" => LABELING_DIFFERENT
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method autoOutput from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->autoOutput();
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method drawGradientArea from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->drawGradientArea(0, 0, $width, $height, DIRECTION_HORIZONTAL, $Settings);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \DIRECTION_HORIZONTAL
                                            Open

                                                    $myPicture->drawGradientArea(0, 0, $width, $height, DIRECTION_HORIZONTAL, $Settings);
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method drawRectangle from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->drawRectangle(0, 0, $width - 1, $height - 1, array("R" => 0, "G" => 0, "B" => 0));
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to deprecated function \debug_event() defined at /code/src/Config/functions.php:651
                                            Open

                                                    debug_event(__CLASS__, 'Access denied, statistical graph disabled.', 1);
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method fetch_assoc from undeclared class \Ampache\Module\System\Dba
                                            Open

                                                    while ($results = Dba::fetch_assoc($db_results)) {
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method fetch_assoc from undeclared class \Ampache\Module\System\Dba
                                            Open

                                                    while ($results = Dba::fetch_assoc($db_results)) {
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \DIRECTION_VERTICAL
                                            Open

                                                    $myPicture->drawGradientArea(0, 0, $width, $height, DIRECTION_VERTICAL, $Settings);
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method drawText from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->drawText(150, 35, $title, array("FontSize" => 20, "Align" => TEXT_ALIGN_BOTTOMMIDDLE));
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method create_from_id from undeclared class \Ampache\Repository\Model\Catalog
                                            Open

                                                            $catalog = Catalog::create_from_id($catalog_id);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method fetch_assoc from undeclared class \Ampache\Module\System\Dba
                                            Open

                                                    while ($results = Dba::fetch_assoc($db_results)) {
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setXAxisDisplay from undeclared class \CpChart\Data
                                            Open

                                                            $MyData->setXAxisDisplay(AXIS_FORMAT_DATE, "Y");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setXAxisDisplay from undeclared class \CpChart\Data
                                            Open

                                                            $MyData->setXAxisDisplay(AXIS_FORMAT_DATE, "Y-m-d");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Parameter $MyData has undeclared type \CpChart\Data
                                            Open

                                                protected function get_user_all_pts(
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method get_catalogs from undeclared class \Ampache\Repository\Model\Catalog
                                            Open

                                                        $catalogs = Catalog::get_catalogs();
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \TEXT_ALIGN_BOTTOMMIDDLE
                                            Open

                                                    $myPicture->drawText(150, 35, $title, array("FontSize" => 20, "Align" => TEXT_ALIGN_BOTTOMMIDDLE));
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method writeLabel from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->writeLabel("Inbound", 720);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setAxisDisplay from undeclared class \CpChart\Data
                                            Open

                                                    $MyData->setAxisDisplay(0, AXIS_FORMAT_METRIC);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Argument 3 (object_type) is null but \Ampache\Module\Util\Graph::get_all_type_pts() takes string defined at /code/src/Module/Util/Graph.php:160
                                            Open

                                                    $values = $this->get_all_type_pts('get_user_hits_pts', $user_id, null, 0, $start_date, $end_date, 'month');
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method read from undeclared class \Ampache\Module\System\Dba
                                            Open

                                                    $db_results = Dba::read($sql);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method fetch_assoc from undeclared class \Ampache\Module\System\Dba
                                            Open

                                                    while ($results = Dba::fetch_assoc($db_results)) {
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method drawScale from undeclared class \CpChart\image
                                            Open

                                                    $myPicture->drawScale($scaleSettings);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \LEGEND_HORIZONTAL
                                            Open

                                                    $myPicture->drawLegend(280, 20, array("Style" => LEGEND_NOBORDER, "Mode" => LEGEND_HORIZONTAL));
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setAxisName from undeclared class \CpChart\Data
                                            Open

                                                    $MyData->setAxisName(0, "Size");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method __construct from undeclared class \CpChart\Data
                                            Open

                                                    $MyData = new Data();
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \AXIS_FORMAT_METRIC
                                            Open

                                                    $MyData->setAxisDisplay(0, AXIS_FORMAT_METRIC);
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setAxisUnit from undeclared class \CpChart\Data
                                            Open

                                                    $MyData->setAxisUnit(0, "B");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setAxisDisplay from undeclared class \CpChart\Data
                                            Open

                                                    $MyData->setAxisDisplay(0, AXIS_FORMAT_CUSTOM, "pGraph_Yformat_bytes");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Reference to undeclared constant \AXIS_FORMAT_CUSTOM
                                            Open

                                                    $MyData->setAxisDisplay(0, AXIS_FORMAT_CUSTOM, "pGraph_Yformat_bytes");
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method __construct from undeclared class \CpChart\Data
                                            Open

                                                    $MyData = new Data();
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setAxisName from undeclared class \CpChart\Data
                                            Open

                                                    $MyData->setAxisName(0, "Files");
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Call to method setAxisDisplay from undeclared class \CpChart\Data
                                            Open

                                                    $MyData->setAxisDisplay(0, AXIS_FORMAT_METRIC);
                                            Severity: Critical
                                            Found in src/Module/Util/Graph.php by phan

                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                            Open

                                                public function render_user_bandwidth(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Major
                                            Found in src/Module/Util/Graph.php and 1 other location - About 3 hrs to fix
                                            src/Module/Util/Graph.php on lines 749..775

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 150.

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

                                            Similar blocks of code found in 2 locations. Consider refactoring.
                                            Open

                                                public function render_catalog_files(
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Major
                                            Found in src/Module/Util/Graph.php and 1 other location - About 3 hrs to fix
                                            src/Module/Util/Graph.php on lines 672..689

                                            Duplicated Code

                                            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                            Tuning

                                            This issue has a mass of 150.

                                            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                            Refactorings

                                            Further Reading

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                protected function get_all_type_pts(
                                                    $fct,
                                                    $id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $user_id is not named in camelCase.
                                            Open

                                                protected function get_user_sql_where(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                protected function get_user_sql_where(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                protected function get_catalog_sql_where(
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $catalog_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                protected function get_user_sql_where(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $catalog_id is not named in camelCase.
                                            Open

                                                protected function get_catalog_sql_where(
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $catalog_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                protected function get_catalog_sql_where(
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $catalog_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                protected function get_user_sql_where(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                protected function get_catalog_sql_where(
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $catalog_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                protected function get_user_sql_where(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                protected function get_catalog_sql_where(
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $catalog_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                protected function get_all_type_pts(
                                                    $fct,
                                                    $id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $user_id is not named in camelCase.
                                            Open

                                                protected function get_user_object_count_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                protected function get_user_bandwidth_pts($user_id = 0, $object_type = 'song', $object_id = 0, $start_date = null, $end_date = null, $zoom = 'day'): array
                                                {
                                                    return $this->get_user_object_count_pts($user_id, $object_type, $object_id, $start_date, $end_date, $zoom);
                                                }
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $MyData is not named in camelCase.
                                            Open

                                                protected function render_graph($title, Data $MyData, $zoom, $width = 0, $height = 0)
                                                {
                                                    // Check graph size sanity
                                                    $width = (int)$width;
                                                    if ($width <= 50 || $width > 4096) {
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $user_id is not named in camelCase.
                                            Open

                                                public function render_user_bandwidth(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                public function render_user_bandwidth(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                public function get_total_bandwidth($user_id = 0, $start_date = null, $end_date = null): int
                                                {
                                                    $total  = 0;
                                                    $values = $this->get_all_type_pts('get_user_bandwidth_pts', $user_id, null, 0, $start_date, $end_date, 'month');
                                                    foreach ($values as $date => $value) {
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                public function render_catalog_size(
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $user_id is not named in camelCase.
                                            Open

                                                public function display_map(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                protected function get_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $show_total is not named in camelCase.
                                            Open

                                                protected function get_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                public function render_user_hits(
                                                    $user_id,
                                                    $object_type,
                                                    $object_id,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                public function render_user_bandwidth(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                protected function get_all_type_pts(
                                                    $fct,
                                                    $id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                protected function get_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $MyData is not named in camelCase.
                                            Open

                                                protected function get_user_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                protected function get_user_hits_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                public function render_user_hits(
                                                    $user_id,
                                                    $object_type,
                                                    $object_id,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                public function render_catalog_files(
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $catalog_id is not named in camelCase.
                                            Open

                                                public function render_catalog_size(
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                protected function get_user_bandwidth_pts($user_id = 0, $object_type = 'song', $object_id = 0, $start_date = null, $end_date = null, $zoom = 'day'): array
                                                {
                                                    return $this->get_user_object_count_pts($user_id, $object_type, $object_id, $start_date, $end_date, $zoom);
                                                }
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                public function render_user_hits(
                                                    $user_id,
                                                    $object_type,
                                                    $object_id,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                public function get_total_bandwidth($user_id = 0, $start_date = null, $end_date = null): int
                                                {
                                                    $total  = 0;
                                                    $values = $this->get_all_type_pts('get_user_bandwidth_pts', $user_id, null, 0, $start_date, $end_date, 'month');
                                                    foreach ($values as $date => $value) {
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                public function display_map(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                public function display_map(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            Avoid variables with short names like $id. Configured minimum length is 3.
                                            Open

                                                    $id = 0,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            ShortVariable

                                            Since: 0.2

                                            Detects when a field, local, or parameter has a very short name.

                                            Example

                                            class Something {
                                                private $q = 15; // VIOLATION - Field
                                                public static function main( array $as ) { // VIOLATION - Formal
                                                    $r = 20 + $this->q; // VIOLATION - Local
                                                    for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                                                        $r += $this->q;
                                                    }
                                                }
                                            }

                                            Source https://phpmd.org/rules/naming.html#shortvariable

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                protected function get_user_hits_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $user_id is not named in camelCase.
                                            Open

                                                protected function get_geolocation_pts(
                                                    $user_id = 0,
                                                    $object_type = '',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $user_id is not named in camelCase.
                                            Open

                                                public function render_user_hits(
                                                    $user_id,
                                                    $object_type,
                                                    $object_id,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                public function display_map(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $user_id is not named in camelCase.
                                            Open

                                                protected function get_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                protected function get_user_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                protected function get_user_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                protected function get_user_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                protected function get_catalog_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                protected function get_user_hits_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $user_id is not named in camelCase.
                                            Open

                                                protected function get_user_time_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                public function render_catalog_size(
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                public function display_map(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                protected function get_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $user_id is not named in camelCase.
                                            Open

                                                protected function get_user_bandwidth_pts($user_id = 0, $object_type = 'song', $object_id = 0, $start_date = null, $end_date = null, $zoom = 'day'): array
                                                {
                                                    return $this->get_user_object_count_pts($user_id, $object_type, $object_id, $start_date, $end_date, $zoom);
                                                }
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                protected function get_user_time_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                protected function get_catalog_size_pts(
                                                    $catalog_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                public function render_user_hits(
                                                    $user_id,
                                                    $object_type,
                                                    $object_id,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                public function get_total_time($user_id = 0, $start_date = null, $end_date = null): int
                                                {
                                                    $total  = 0;
                                                    $values = $this->get_all_type_pts('get_user_time_pts', $user_id, null, 0, $start_date, $end_date, 'month');
                                                    foreach ($values as $date => $value) {
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                public function get_total_time($user_id = 0, $start_date = null, $end_date = null): int
                                                {
                                                    $total  = 0;
                                                    $values = $this->get_all_type_pts('get_user_time_pts', $user_id, null, 0, $start_date, $end_date, 'month');
                                                    foreach ($values as $date => $value) {
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                public function render_catalog_size(
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                public function render_catalog_size(
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                protected function get_user_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                protected function get_catalog_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                protected function get_user_object_count_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                protected function get_user_bandwidth_pts($user_id = 0, $object_type = 'song', $object_id = 0, $start_date = null, $end_date = null, $zoom = 'day'): array
                                                {
                                                    return $this->get_user_object_count_pts($user_id, $object_type, $object_id, $start_date, $end_date, $zoom);
                                                }
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                protected function get_catalog_files_pts(
                                                    $catalog_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                protected function get_geolocation_pts(
                                                    $user_id = 0,
                                                    $object_type = '',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                protected function get_user_time_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                protected function get_user_time_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                protected function get_catalog_size_pts(
                                                    $catalog_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                protected function get_geolocation_pts(
                                                    $user_id = 0,
                                                    $object_type = '',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                public function render_catalog_files(
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $user_id is not named in camelCase.
                                            Open

                                                protected function get_user_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                protected function get_user_time_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                protected function get_catalog_files_pts(
                                                    $catalog_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                protected function get_catalog_size_pts(
                                                    $catalog_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                public function render_user_bandwidth(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $catalog_id is not named in camelCase.
                                            Open

                                                public function render_catalog_files(
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $MyData is not named in camelCase.
                                            Open

                                                protected function get_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $user_id is not named in camelCase.
                                            Open

                                                protected function get_user_hits_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                protected function get_user_object_count_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                protected function get_user_bandwidth_pts($user_id = 0, $object_type = 'song', $object_id = 0, $start_date = null, $end_date = null, $zoom = 'day'): array
                                                {
                                                    return $this->get_user_object_count_pts($user_id, $object_type, $object_id, $start_date, $end_date, $zoom);
                                                }
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $catalog_id is not named in camelCase.
                                            Open

                                                protected function get_catalog_size_pts(
                                                    $catalog_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $user_id is not named in camelCase.
                                            Open

                                                public function get_total_hits($user_id = 0, $start_date = null, $end_date = null): int
                                                {
                                                    $total  = 0;
                                                    $values = $this->get_all_type_pts('get_user_hits_pts', $user_id, null, 0, $start_date, $end_date, 'month');
                                                    foreach ($values as $date => $value) {
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                public function render_catalog_files(
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                protected function get_all_type_pts(
                                                    $fct,
                                                    $id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                protected function get_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $user_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                protected function get_user_hits_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $catalog_id is not named in camelCase.
                                            Open

                                                protected function get_catalog_files_pts(
                                                    $catalog_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                protected function get_catalog_files_pts(
                                                    $catalog_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                protected function get_geolocation_pts(
                                                    $user_id = 0,
                                                    $object_type = '',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $MyData is not named in camelCase.
                                            Open

                                                protected function get_catalog_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                protected function get_catalog_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                protected function get_catalog_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                public function get_total_hits($user_id = 0, $start_date = null, $end_date = null): int
                                                {
                                                    $total  = 0;
                                                    $values = $this->get_all_type_pts('get_user_hits_pts', $user_id, null, 0, $start_date, $end_date, 'month');
                                                    foreach ($values as $date => $value) {
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $catalog_id is not named in camelCase.
                                            Open

                                                protected function get_catalog_all_pts(
                                                    $fct,
                                                    Data $MyData,
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                protected function get_catalog_size_pts(
                                                    $catalog_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                public function render_catalog_files(
                                                    $catalog_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_type is not named in camelCase.
                                            Open

                                                protected function get_user_object_count_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                protected function get_catalog_files_pts(
                                                    $catalog_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $user_id is not named in camelCase.
                                            Open

                                                public function get_total_bandwidth($user_id = 0, $start_date = null, $end_date = null): int
                                                {
                                                    $total  = 0;
                                                    $values = $this->get_all_type_pts('get_user_bandwidth_pts', $user_id, null, 0, $start_date, $end_date, 'month');
                                                    foreach ($values as $date => $value) {
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $start_date is not named in camelCase.
                                            Open

                                                protected function get_user_object_count_pts(
                                                    $user_id = 0,
                                                    $object_type = 'song',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                protected function get_geolocation_pts(
                                                    $user_id = 0,
                                                    $object_type = '',
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $object_id is not named in camelCase.
                                            Open

                                                public function render_user_bandwidth(
                                                    $user_id = 0,
                                                    $object_type = null,
                                                    $object_id = 0,
                                                    $start_date = null,
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $user_id is not named in camelCase.
                                            Open

                                                public function get_total_time($user_id = 0, $start_date = null, $end_date = null): int
                                                {
                                                    $total  = 0;
                                                    $values = $this->get_all_type_pts('get_user_time_pts', $user_id, null, 0, $start_date, $end_date, 'month');
                                                    foreach ($values as $date => $value) {
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            The parameter $end_date is not named in camelCase.
                                            Open

                                                public function get_total_hits($user_id = 0, $start_date = null, $end_date = null): int
                                                {
                                                    $total  = 0;
                                                    $values = $this->get_all_type_pts('get_user_hits_pts', $user_id, null, 0, $start_date, $end_date, 'month');
                                                    foreach ($values as $date => $value) {
                                            Severity: Minor
                                            Found in src/Module/Util/Graph.php by phpmd

                                            CamelCaseParameterName

                                            Since: 0.2

                                            It is considered best practice to use the camelCase notation to name parameters.

                                            Example

                                            class ClassName {
                                                public function doSomething($user_name) {
                                                }
                                            }

                                            Source

                                            There are no issues that match your filters.

                                            Category
                                            Status