howardjones/network-weathermap

View on GitHub

Showing 380 of 1,093 total issues

WeatherMapCactiManagementPlugin has 49 functions (exceeds 20 allowed). Consider refactoring.
Open

class WeatherMapCactiManagementPlugin extends UIBase
{

    public $cactiBasePath;
    /** @var MapManager $manager */
Severity: Minor
Found in lib/Weathermap/Integrations/Cacti/WeatherMapCactiManagementPlugin.php - About 6 hrs to fix

    Function weathermap_poller_output has a Cognitive Complexity of 44 (exceeds 5 allowed). Consider refactoring.
    Open

    function weathermap_poller_output($rrdUpdateArray)
    {
        global $config;
    
        $pdo = weathermap_get_pdo();
    Severity: Minor
    Found in lib/Weathermap/Integrations/Cacti/cacti-plugin-poller.php - About 6 hrs 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 readFromRealRRDtool has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
    Open

        private function readFromRealRRDtool($rrdfile, $cf, $start, $end, $dsnames, &$map, &$item)
        {
            MapUtility::debug("RRD ReadData: traditional style\n");
    
            // we get the last 800 seconds of data - this might be 1 or 2 lines, depending on when in the
    Severity: Minor
    Found in lib/Weathermap/Plugins/Datasources/RRDTool.php - About 6 hrs 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

    File Legend.php has 433 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace Weathermap\Core;
    
    /**
    Severity: Minor
    Found in lib/Weathermap/Core/Legend.php - About 6 hrs to fix

      File cacti88-plugin-hooks.php has 429 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      function weathermap_setup_table()
      {
          $dbversion = \read_config_option('weathermap_db_version');
      
      
      Severity: Minor
      Found in lib/Weathermap/Integrations/Cacti/cacti88-plugin-hooks.php - About 6 hrs to fix

        Function readData has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
        Open

            public function readData($targetString, &$map, &$mapItem)
            {
                $this->data[IN] = null;
                $this->data[OUT] = null;
        
        
        Severity: Minor
        Found in lib/Weathermap/Plugins/Datasources/SNMP1.php - About 6 hrs 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 calculateImagemap has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
        Open

            public function calculateImagemap()
            {
                MapUtility::debug("Trace: calculateImagemap()\n");
        
                // loop through everything. Figure out along the way if it's a node or a link
        Severity: Minor
        Found in lib/Weathermap/Core/Map.php - About 6 hrs 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 readData has a Cognitive Complexity of 41 (exceeds 5 allowed). Consider refactoring.
        Open

            public function readData($targetString, &$map, &$mapItem)
            {
                $this->data[IN] = null;
                $this->data[OUT] = null;
        
        
        Severity: Minor
        Found in lib/Weathermap/Plugins/Datasources/SNMP2c.php - About 6 hrs 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

        File cacti10-plugin-hooks.php has 418 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        function weathermap_setup_table()
        {
            $dbversion = \read_config_option('weathermap_db_version');
        Severity: Minor
        Found in lib/Weathermap/Integrations/Cacti/cacti10-plugin-hooks.php - About 6 hrs to fix

          File RRDTool.php has 414 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          // RRDtool datasource plugin.
          //     gauge:filename.rrd:ds_in:ds_out
          //     filename.rrd:ds_in:ds_out
          //     filename.rrd:ds_in:ds_out
          Severity: Minor
          Found in lib/Weathermap/Plugins/Datasources/RRDTool.php - About 5 hrs to fix

            Editor has 43 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Editor
            {
                /** @var Map $map */
                public $map;
                /** @var string $mapFileName */
            Severity: Minor
            Found in lib/Weathermap/Editor/Editor.php - About 5 hrs to fix

              Function preRender has a Cognitive Complexity of 38 (exceeds 5 allowed). Consider refactoring.
              Open

                  public function preRender(&$map)
                  {
                      if (!$this->drawable) {
                          MapUtility::debug('Skipping undrawable %s', $this);
                          return;
              Severity: Minor
              Found in lib/Weathermap/Core/MapNode.php - About 5 hrs 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 preRender has 141 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function preRender(&$map)
                  {
                      if (!$this->drawable) {
                          MapUtility::debug('Skipping undrawable %s', $this);
                          return;
              Severity: Major
              Found in lib/Weathermap/Core/MapNode.php - About 5 hrs to fix

                File MapManagerTest.php has 397 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                namespace Weathermap\Tests;
                
                require_once dirname(__FILE__) . '/../../all.php';
                Severity: Minor
                Found in lib/Weathermap/Tests/MapManagerTest.php - About 5 hrs to fix

                  Method getConfig has 137 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function getConfig()
                      {
                          if ($this->configOverride != '') {
                              return $this->configOverride . "\n";
                          }
                  Severity: Major
                  Found in lib/Weathermap/Core/MapLink.php - About 5 hrs to fix

                    File EditorTest.php has 393 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    //
                    //require_once dirname(__FILE__) . '/../lib/all.php';
                    //require_once dirname(__FILE__) . '/../lib/Editor.php';
                    //include_once dirname(__FILE__) . "/WMTestSupport.php";
                    Severity: Minor
                    Found in lib/Weathermap/Tests/EditorTest.php - About 5 hrs to fix

                      Function getConfig has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function getConfig()
                          {
                              if ($this->configOverride != '') {
                                  return $this->configOverride . "\n";
                              }
                      Severity: Minor
                      Found in lib/Weathermap/Core/MapNode.php - About 5 hrs 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 selfValidate has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function selfValidate()
                          {
                              $classes = array(
                                  'GLOBAL' => 'Weathermap\\Core\\Map',
                                  'LINK' => 'Weathermap\\Core\\MapLink',
                      Severity: Minor
                      Found in lib/Weathermap/Core/ConfigReader.php - About 4 hrs 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 readData has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                      Open

                          public function readData($targetString, &$map, &$mapItem)
                          {
                              $this->data[IN] = null;
                              $this->data[OUT] = null;
                              $dsnames = array(IN => "traffic_in", OUT => "traffic_out");
                      Severity: Minor
                      Found in lib/Weathermap/Plugins/Datasources/RRDTool.php - About 4 hrs 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 maplist has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring.
                      Open

                          protected function maplist()
                          {
                              \html_start_box(
                                  __('Weathermaps'),
                                  '100%',
                      Severity: Minor
                      Found in lib/Weathermap/Integrations/Cacti/WeatherMapCactiManagementPlugin.php - About 4 hrs 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

                      Severity
                      Category
                      Status
                      Source
                      Language