librenms/librenms

View on GitHub
includes/html/collectd/definitions.php

Summary

Maintainability
F
3 wks
Test Coverage

Method load_graph_definitions has 1568 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function load_graph_definitions($logarithmic = false, $tinylegend = false)
{
    global $GraphDefs, $MetaGraphDefs;

    $Canvas = 'FFFFFF';
Severity: Major
Found in includes/html/collectd/definitions.php - About 1 wk to fix

    File definitions.php has 1971 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    // vim:fenc=utf-8:filetype=php:ts=4
    /*
     * Copyright (C) 2009  Bruno Prémont <bonbons AT linux-vserver.org>
    Severity: Major
    Found in includes/html/collectd/definitions.php - About 5 days to fix

      Function load_graph_definitions has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
      Open

      function load_graph_definitions($logarithmic = false, $tinylegend = false)
      {
          global $GraphDefs, $MetaGraphDefs;
      
          $Canvas = 'FFFFFF';
      Severity: Minor
      Found in includes/html/collectd/definitions.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 meta_graph_tcp_connections has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      function meta_graph_tcp_connections($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
      {
          $sources = [];
      
          $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
      Severity: Minor
      Found in includes/html/collectd/definitions.php - About 1 hr to fix

        Method meta_graph_apache_scoreboard has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        function meta_graph_apache_scoreboard($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
        {
            $sources = [];
        
            $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
        Severity: Minor
        Found in includes/html/collectd/definitions.php - About 1 hr to fix

          Function meta_graph_if_rx_errors has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function meta_graph_if_rx_errors($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
          {
              $sources = [];
          
              $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
          Severity: Minor
          Found in includes/html/collectd/definitions.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 meta_graph_nfs_procedure has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function meta_graph_nfs_procedure($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
          {
              $sources = [];
          
              $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
          Severity: Minor
          Found in includes/html/collectd/definitions.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 meta_graph_files_count has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function meta_graph_files_count($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
          {
              $sources = [];
          
              $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
          Severity: Minor
          Found in includes/html/collectd/definitions.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 meta_graph_files_size has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function meta_graph_files_size($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
          {
              $sources = [];
          
              $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
          Severity: Minor
          Found in includes/html/collectd/definitions.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 meta_graph_memory has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function meta_graph_memory($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
          {
              $sources = [];
          
              $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
          Severity: Minor
          Found in includes/html/collectd/definitions.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 meta_graph_vs_threads has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function meta_graph_vs_threads($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
          {
              $sources = [];
          
              $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
          Severity: Minor
          Found in includes/html/collectd/definitions.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 meta_graph_vs_memory has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function meta_graph_vs_memory($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
          {
              $sources = [];
          
              $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
          Severity: Minor
          Found in includes/html/collectd/definitions.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 meta_graph_swap has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function meta_graph_swap($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
          {
              $sources = [];
          
              $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
          Severity: Minor
          Found in includes/html/collectd/definitions.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 meta_graph_mysql_commands has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function meta_graph_mysql_commands($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
          {
              $sources = [];
          
              $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
          Severity: Minor
          Found in includes/html/collectd/definitions.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 meta_graph_apache_scoreboard has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function meta_graph_apache_scoreboard($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
          {
              $sources = [];
          
              $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
          Severity: Minor
          Found in includes/html/collectd/definitions.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 meta_graph_ps_state has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function meta_graph_ps_state($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
          {
              $sources = [];
          
              $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
          Severity: Minor
          Found in includes/html/collectd/definitions.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 meta_graph_tcp_connections has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function meta_graph_tcp_connections($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
          {
              $sources = [];
          
              $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
          Severity: Minor
          Found in includes/html/collectd/definitions.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 meta_graph_cpu has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
          Open

          function meta_graph_cpu($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
          {
              $sources = [];
          
              $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
          Severity: Minor
          Found in includes/html/collectd/definitions.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 meta_graph_cpu has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          function meta_graph_cpu($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
          {
              $sources = [];
          
              $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
          Severity: Minor
          Found in includes/html/collectd/definitions.php - About 1 hr to fix

            Method meta_graph_ps_state has 29 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function meta_graph_ps_state($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
            {
                $sources = [];
            
                $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
            Severity: Minor
            Found in includes/html/collectd/definitions.php - About 1 hr to fix

              Method meta_graph_vs_threads has 28 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              function meta_graph_vs_threads($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
              {
                  $sources = [];
              
                  $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
              Severity: Minor
              Found in includes/html/collectd/definitions.php - About 1 hr to fix

                Method meta_graph_memory has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function meta_graph_memory($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                {
                    $sources = [];
                
                    $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
                Severity: Minor
                Found in includes/html/collectd/definitions.php - About 1 hr to fix

                  Method meta_graph_vs_memory has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  function meta_graph_vs_memory($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                  {
                      $sources = [];
                  
                      $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
                  Severity: Minor
                  Found in includes/html/collectd/definitions.php - About 1 hr to fix

                    Method meta_graph_swap has 27 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    function meta_graph_swap($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                    {
                        $sources = [];
                    
                        $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
                    Severity: Minor
                    Found in includes/html/collectd/definitions.php - About 1 hr to fix

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

                      function meta_graph_files_count($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                      {
                          $sources = [];
                      
                          $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
                      Severity: Minor
                      Found in includes/html/collectd/definitions.php - About 1 hr to fix

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

                        function meta_graph_files_size($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                        {
                            $sources = [];
                        
                            $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
                        Severity: Minor
                        Found in includes/html/collectd/definitions.php - About 1 hr to fix

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

                          function meta_graph_vs_memory($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                          Severity: Minor
                          Found in includes/html/collectd/definitions.php - About 45 mins to fix

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

                            function meta_graph_files_size($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                            Severity: Minor
                            Found in includes/html/collectd/definitions.php - About 45 mins to fix

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

                              function meta_graph_vs_threads($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                              Severity: Minor
                              Found in includes/html/collectd/definitions.php - About 45 mins to fix

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

                                function meta_graph_apache_scoreboard($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                                Severity: Minor
                                Found in includes/html/collectd/definitions.php - About 45 mins to fix

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

                                  function meta_graph_tcp_connections($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                                  Severity: Minor
                                  Found in includes/html/collectd/definitions.php - About 45 mins to fix

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

                                    function meta_graph_nfs_procedure($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                                    Severity: Minor
                                    Found in includes/html/collectd/definitions.php - About 45 mins to fix

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

                                      function meta_graph_memory($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                                      Severity: Minor
                                      Found in includes/html/collectd/definitions.php - About 45 mins to fix

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

                                        function meta_graph_if_rx_errors($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                                        Severity: Minor
                                        Found in includes/html/collectd/definitions.php - About 45 mins to fix

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

                                          function meta_graph_cpu($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                                          Severity: Minor
                                          Found in includes/html/collectd/definitions.php - About 45 mins to fix

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

                                            function meta_graph_files_count($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                                            Severity: Minor
                                            Found in includes/html/collectd/definitions.php - About 45 mins to fix

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

                                              function meta_graph_mysql_commands($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                                              Severity: Minor
                                              Found in includes/html/collectd/definitions.php - About 45 mins to fix

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

                                                function meta_graph_ps_state($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                                                Severity: Minor
                                                Found in includes/html/collectd/definitions.php - About 45 mins to fix

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

                                                  function meta_graph_swap($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                                                  Severity: Minor
                                                  Found in includes/html/collectd/definitions.php - About 45 mins to fix

                                                    The function load_graph_definitions() has 1637 lines of code. Current threshold is set to 100. Avoid really long methods.
                                                    Open

                                                    function load_graph_definitions($logarithmic = false, $tinylegend = false)
                                                    {
                                                        global $GraphDefs, $MetaGraphDefs;
                                                    
                                                        $Canvas = 'FFFFFF';

                                                    The method load_graph_definitions has a boolean flag argument $logarithmic, which is a certain sign of a Single Responsibility Principle violation.
                                                    Open

                                                    function load_graph_definitions($logarithmic = false, $tinylegend = false)

                                                    BooleanArgumentFlag

                                                    Since: 1.4.0

                                                    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                                    Example

                                                    class Foo {
                                                        public function bar($flag = true) {
                                                        }
                                                    }

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

                                                    The method load_graph_definitions has a boolean flag argument $tinylegend, which is a certain sign of a Single Responsibility Principle violation.
                                                    Open

                                                    function load_graph_definitions($logarithmic = false, $tinylegend = false)

                                                    BooleanArgumentFlag

                                                    Since: 1.4.0

                                                    A boolean flag argument is a reliable indicator for a violation of the Single Responsibility Principle (SRP). You can fix this problem by extracting the logic in the boolean flag into its own class or method.

                                                    Example

                                                    class Foo {
                                                        public function bar($flag = true) {
                                                        }
                                                    }

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

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

                                                        foreach ($type_instances as $k => $inst) {

                                                    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 '$k'.
                                                    Open

                                                        foreach ($type_instances as $k => $inst) {

                                                    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 '$k'.
                                                    Open

                                                        foreach ($type_instances as $k => $inst) {

                                                    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 '$k'.
                                                    Open

                                                        foreach ($type_instances as $k => $inst) {

                                                    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 '$k'.
                                                    Open

                                                        foreach ($type_instances as $k => $inst) {

                                                    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 '$k'.
                                                    Open

                                                        foreach ($type_instances as $k => $inst) {

                                                    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 '$k'.
                                                    Open

                                                        foreach ($type_instances as $k => $inst) {

                                                    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 '$k'.
                                                    Open

                                                        foreach ($type_instances as $k => $inst) {

                                                    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 '$k'.
                                                    Open

                                                        foreach ($type_instances as $k => $inst) {

                                                    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 '$k'.
                                                    Open

                                                        foreach ($type_instances as $k => $inst) {

                                                    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 '$k'.
                                                    Open

                                                        foreach ($type_instances as $k => $inst) {

                                                    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 '$k'.
                                                    Open

                                                        foreach ($type_instances as $k => $inst) {

                                                    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 '$k'.
                                                    Open

                                                        foreach ($type_instances as $k => $inst) {

                                                    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

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

                                                    function meta_graph_files_count($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                                                    {
                                                        $sources = [];
                                                    
                                                        $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
                                                    Severity: Major
                                                    Found in includes/html/collectd/definitions.php and 1 other location - About 1 day to fix
                                                    includes/html/collectd/definitions.php on lines 1703..1736

                                                    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 296.

                                                    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

                                                    function meta_graph_files_size($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                                                    {
                                                        $sources = [];
                                                    
                                                        $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
                                                    Severity: Major
                                                    Found in includes/html/collectd/definitions.php and 1 other location - About 1 day to fix
                                                    includes/html/collectd/definitions.php on lines 1668..1701

                                                    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 296.

                                                    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

                                                    function meta_graph_if_rx_errors($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                                                    {
                                                        $sources = [];
                                                    
                                                        $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
                                                    Severity: Major
                                                    Found in includes/html/collectd/definitions.php and 1 other location - About 1 day to fix
                                                    includes/html/collectd/definitions.php on lines 1948..1975

                                                    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 263.

                                                    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

                                                    function meta_graph_nfs_procedure($host, $plugin, $plugin_instance, $type, $type_instances, $opts = [])
                                                    {
                                                        $sources = [];
                                                    
                                                        $title = "$host/$plugin" . (! is_null($plugin_instance) ? "-$plugin_instance" : '') . "/$type";
                                                    Severity: Major
                                                    Found in includes/html/collectd/definitions.php and 1 other location - About 1 day to fix
                                                    includes/html/collectd/definitions.php on lines 1890..1917

                                                    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 263.

                                                    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

                                                        $GraphDefs['vs_threads'] = [
                                                            'DEF:total_avg={file}:total:AVERAGE',
                                                            'DEF:total_min={file}:total:MIN',
                                                            'DEF:total_max={file}:total:MAX',
                                                            'DEF:running_avg={file}:running:AVERAGE',
                                                    Severity: Major
                                                    Found in includes/html/collectd/definitions.php and 1 other location - About 2 hrs to fix
                                                    includes/html/collectd/definitions.php on lines 1584..1616

                                                    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 124.

                                                    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

                                                        $GraphDefs['vs_memory'] = [
                                                            'DEF:vm_avg={file}:vm:AVERAGE',
                                                            'DEF:vm_min={file}:vm:MIN',
                                                            'DEF:vm_max={file}:vm:MAX',
                                                            'DEF:vml_avg={file}:vml:AVERAGE',
                                                    Severity: Major
                                                    Found in includes/html/collectd/definitions.php and 1 other location - About 2 hrs to fix
                                                    includes/html/collectd/definitions.php on lines 1551..1583

                                                    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 124.

                                                    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

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

                                                        foreach ($type_instances as $k => $inst) {
                                                            $file = '';
                                                            foreach (Config::get('datadirs') as $datadir) {
                                                                if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
                                                                    $file = $datadir . '/' . $title . '-' . $inst . '.rrd';
                                                    Severity: Major
                                                    Found in includes/html/collectd/definitions.php and 1 other location - About 2 hrs to fix
                                                    includes/html/collectd/definitions.php on lines 2077..2090

                                                    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 123.

                                                    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

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

                                                        foreach ($type_instances as $k => $inst) {
                                                            $file = '';
                                                            foreach (Config::get('datadirs') as $datadir) {
                                                                if (is_file($datadir . '/' . $title . '-' . $inst . '.rrd')) {
                                                                    $file = $datadir . '/' . $title . '-' . $inst . '.rrd';
                                                    Severity: Major
                                                    Found in includes/html/collectd/definitions.php and 1 other location - About 2 hrs to fix
                                                    includes/html/collectd/definitions.php on lines 2122..2135

                                                    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 123.

                                                    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 3 locations. Consider refactoring.
                                                    Open

                                                        $GraphDefs['if_errors'] = [
                                                            //'-v', 'Errors/s',
                                                            '--units=si',
                                                            'DEF:tx_min={file}:tx:MIN',
                                                            'DEF:tx_avg={file}:tx:AVERAGE',
                                                    Severity: Major
                                                    Found in includes/html/collectd/definitions.php and 2 other locations - About 1 hr to fix
                                                    includes/html/collectd/definitions.php on lines 557..587
                                                    includes/html/collectd/definitions.php on lines 588..618

                                                    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 113.

                                                    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 3 locations. Consider refactoring.
                                                    Open

                                                        $GraphDefs['if_packets'] = [
                                                            //'-v', 'Packets/s',
                                                            '--units=si',
                                                            'DEF:tx_min={file}:tx:MIN',
                                                            'DEF:tx_avg={file}:tx:AVERAGE',
                                                    Severity: Major
                                                    Found in includes/html/collectd/definitions.php and 2 other locations - About 1 hr to fix
                                                    includes/html/collectd/definitions.php on lines 511..541
                                                    includes/html/collectd/definitions.php on lines 557..587

                                                    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 113.

                                                    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 3 locations. Consider refactoring.
                                                    Open

                                                        $GraphDefs['if_dropped'] = [
                                                            //'-v', 'Packets/s',
                                                            '--units=si',
                                                            'DEF:tx_min={file}:tx:MIN',
                                                            'DEF:tx_avg={file}:tx:AVERAGE',
                                                    Severity: Major
                                                    Found in includes/html/collectd/definitions.php and 2 other locations - About 1 hr to fix
                                                    includes/html/collectd/definitions.php on lines 511..541
                                                    includes/html/collectd/definitions.php on lines 588..618

                                                    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 113.

                                                    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

                                                        $GraphDefs['df'] = [
                                                            //'-v', 'Percent',
                                                            '-l', '0',
                                                            'DEF:free_avg={file}:free:AVERAGE',
                                                            'DEF:free_min={file}:free:MIN',
                                                    Severity: Major
                                                    Found in includes/html/collectd/definitions.php and 1 other location - About 1 hr to fix
                                                    includes/html/collectd/definitions.php on lines 1203..1229

                                                    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 101.

                                                    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

                                                        $GraphDefs['ps_cputime'] = [
                                                            //'-v', 'Jiffies',
                                                            'DEF:user_avg_raw={file}:user:AVERAGE',
                                                            'DEF:user_min_raw={file}:user:MIN',
                                                            'DEF:user_max_raw={file}:user:MAX',
                                                    Severity: Major
                                                    Found in includes/html/collectd/definitions.php and 1 other location - About 1 hr to fix
                                                    includes/html/collectd/definitions.php on lines 157..182

                                                    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 101.

                                                    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

                                                    A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 30 and the first side effect is on line 23.
                                                    Open

                                                    <?php

                                                    There are no issues that match your filters.

                                                    Category
                                                    Status