howardjones/network-weathermap

View on GitHub

Showing 380 of 1,093 total issues

Method testTidy has 33 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function testTidy()
    {
        $editor = new Editor();
        $editor->newConfig();

Severity: Minor
Found in lib/Weathermap/Tests/EditorTest.php - About 1 hr to fix

    Method resolveRelativePositions has 33 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        private function resolveRelativePositions()
        {
            // calculate any relative positions here - that way, nothing else
            // really needs to know about them
    
    
    Severity: Minor
    Found in lib/Weathermap/Core/Map.php - About 1 hr to fix

      Method testScaleManagement has 33 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function testScaleManagement()
          {
              $this->object->populateDefaultsIfNecessary();
              $this->assertEquals(9, $this->object->spanCount());
      
      
      Severity: Minor
      Found in lib/Weathermap/Tests/MapScaleTest.php - About 1 hr to fix

        Method resolveRelativePosition has 33 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function resolveRelativePosition($anchorNode)
            {
                $anchorPosition = $anchorNode->getPosition();
        
                if ($this->polar) {
        Severity: Minor
        Found in lib/Weathermap/Core/MapNode.php - About 1 hr to fix

          Method calculateCommentPosition has 33 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              private function calculateCommentPosition($fontObject, $comment, $direction, $widthList)
              {
                  list($textWidth, $textHeight) = $fontObject->calculateImageStringSize($comment);
          
                  // nudge pushes the comment out along the link arrow a little bit
          Severity: Minor
          Found in lib/Weathermap/Core/MapLink.php - About 1 hr to fix

            Method outputTestHTML has 33 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public static function outputTestHTML($htmlfile, &$map)
                {
                    $fd = fopen($htmlfile, 'w');
                    fwrite(
                        $fd,
            Severity: Minor
            Found in lib/Weathermap/Core/MapUtility.php - About 1 hr to fix

              Method selfValidate has 33 lines of code (exceeds 25 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 1 hr to fix

                Method weathermap_poller_bottom has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function weathermap_poller_bottom()
                {
                    global $config;
                    global $weathermapPollerStartTime;
                
                
                Severity: Minor
                Found in lib/Weathermap/Integrations/Cacti/cacti-plugin-poller.php - About 1 hr to fix

                  Function render has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      render() {
                          if (!this.state.map) {
                              return <div className='wm-map-properties-container wm-popup'>No such map? (or loading)</div>
                          }
                  
                  
                  Severity: Minor
                  Found in websrc/cacti-mgmt/src/components/MapProperties.js - About 1 hr to fix

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

                        public function testIndexOrphans()
                        {
                            # Check that all the little config XML files actually appear somewhere in the index.xml
                            $docsIndex = $this->docsRoot . "/index.xml";
                    
                    
                    Severity: Minor
                    Found in lib/Weathermap/Tests/DocsTest.php - About 1 hr to fix

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

                          private function drawRealIcon(&$map, $iconColour)
                          {
                              $this->iconfile = $map->processString($this->iconfile, $this);
                      
                              MapUtility::debug('Actual image-based icon from ' . $this->iconfile . " for $this->name\n");
                      Severity: Minor
                      Found in lib/Weathermap/Core/MapNode.php - About 1 hr to fix

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

                            private function translateRuntimeOptionsToSettings()
                            {
                                global $weathermap_error_suppress;
                        
                                $this->configFile = $this->getOpt->getOption('config');
                        Severity: Minor
                        Found in lib/Weathermap/CLI/Runner.php - About 1 hr to fix

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

                              public function updateLink($linkName, $params)
                              {
                                  if (!$this->isLoaded()) {
                                      throw new WeathermapInternalFail("Map must be loaded before editing API called.");
                                  }
                          Severity: Minor
                          Found in lib/Weathermap/Editor/Editor.php - About 1 hr to fix

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

                                public function configlist()
                                {
                                    self::checkPaths();
                            
                                    $summaryFileName = self::$testSuiteDirectory . DIRECTORY_SEPARATOR . "summary.html";
                            Severity: Minor
                            Found in lib/Weathermap/Tests/ConfigTest.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 show_link has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                            function show_link(name) {
                                mapmode('existing');
                            
                                hide_all_dialogs();
                            
                            
                            Severity: Minor
                            Found in editor-resources/editor.js - 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 drawLegendVertical has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                private function drawLegendVertical($keyHeight = 400, $inverted = false)
                                {
                                    $title = $this->keytitle;
                            
                                    $nScales = $this->scale->spanCount();
                            Severity: Minor
                            Found in lib/Weathermap/Core/Legend.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 findIndexNearDistance has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function findIndexNearDistance($targetDistance)
                                {
                                    $left = 0;
                                    $right = count($this->elements) - 1;
                            
                            
                            Severity: Minor
                            Found in lib/Weathermap/Core/Spine.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 getConfigSimple has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected function getConfigSimple($simpleParameters, $comparison)
                                {
                                    $output = '';
                            
                                    # TEMPLATE must come first. DEFAULT
                            Severity: Minor
                            Found in lib/Weathermap/Core/MapDataItem.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 runOutputTest has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public static function runOutputTest($iconFileName, $imageFileName, $htmlFileName, $newConfigFileName)
                                {
                                    $map = new Map();
                            
                                    $map->readConfig($iconFileName);
                            Severity: Minor
                            Found in lib/Weathermap/Tests/TestSupport.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 createThumbnailFile has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                            Open

                                protected function createThumbnailFile($thumbnailFileName, $thumbnailMaxSize, $imageRef)
                                {
                                    MapUtility::debug("Writing thumbnail to $thumbnailFileName\n");
                            
                                    if (!function_exists('imagecopyresampled')) {
                            Severity: Minor
                            Found in lib/Weathermap/Core/Map.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

                            Severity
                            Category
                            Status
                            Source
                            Language