howardjones/network-weathermap

View on GitHub

Showing 380 of 1,093 total issues

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

    public static function imageFilledRoundedRectangle($imageRef, $left, $top, $right, $bottom, $radius, $color)
Severity: Major
Found in lib/Weathermap/Core/ImageUtility.php - About 50 mins to fix

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

        public static function imageRoundedRectangle($imageRef, $left, $top, $right, $bottom, $radius, $color)
    Severity: Major
    Found in lib/Weathermap/Core/ImageUtility.php - About 50 mins to fix

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

          private function buildOverlibHTML($mapItem, $dir, $imageExtraHTML, $left, $above, $caption)
      Severity: Minor
      Found in lib/Weathermap/Core/Map.php - About 45 mins to fix

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

        function show_node(name) {
            mapmode('existing');
        
            hide_all_dialogs();
        
        
        Severity: Minor
        Found in editor-resources/editor.js - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

        function dataSelected(event) {
            var newlocation;
            var data_id = $(this).data("source-id");
            var path = $(this).data("path");
        
        
        Severity: Minor
        Found in editor-resources/cacti-pick.js - About 45 mins to fix

        Cognitive Complexity

        Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

        A method's cognitive complexity is based on a few simple rules:

        • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
        • Code is considered more complex for each "break in the linear flow of the code"
        • Code is considered more complex when "flow breaking structures are nested"

        Further reading

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

            private function getSNMPData($host, $params, $oids, &$item, $timeout, $retries)
        Severity: Minor
        Found in lib/Weathermap/Plugins/Datasources/SNMP3.php - About 45 mins to fix

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

                  $imageFileName = '',
                  $thumbnailFileName = '',
                  $thumbnailMaxSize = 250,
                  $includeNodes = true,
                  $showVIAOverlay = false,
          Severity: Minor
          Found in lib/Weathermap/Core/Map.php - About 45 mins to fix

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

                private function ping(&$item, $targetAddress, $pingCount)
                {
                    if (!is_executable($this->fpingCommand)) {
                        MapUtility::warn("FPing ReadData: Can't find fping executable. Check path at line 36 of FPing");
                        return;
            Severity: Minor
            Found in lib/Weathermap/Plugins/Datasources/FPing.php - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                initKeys: function (that) {
                    $(document).keyup(function (event) {
                        if (event.keyCode === that.KEYCODE_ESCAPE) {
                            window.location.href = $('#cycle_stop').attr('href');
                            event.preventDefault();
            Severity: Minor
            Found in cacti-resources/map-cycle.js - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

              render() {
            
                let contents = null;
            
                if (this.state.loaded) {
            Severity: Minor
            Found in websrc/cacti-mgmt/src/components/AddMap.js - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                public function testTidyAll()
                {
                    $editor = new Editor();
                    $editor->newConfig();
            
            
            Severity: Minor
            Found in lib/Weathermap/Tests/EditorTest.php - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                public function dispatchRequest($action, $request, $appObject)
                {
                    if (!array_key_exists($action, $this->commands)) {
                        if (array_key_exists(":: DEFAULT ::", $this->commands)) {
                            $action = ":: DEFAULT ::";
            Severity: Minor
            Found in lib/Weathermap/UI/UIBase.php - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                protected function getConfigInOutOrBoth($comparison, $configKeyword, $fieldName)
                {
                    $output = '';
                    $myArray = $this->$fieldName;
                    $theirArray = $comparison->$fieldName;
            Severity: Minor
            Found in lib/Weathermap/Core/MapDataItem.php - About 45 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

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

                private function drawLabelRotated($imageRef, $centre, $degreesAngle, $text, $padding, $direction)
            Severity: Minor
            Found in lib/Weathermap/Core/MapLink.php - About 45 mins to fix

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

                  public function __construct($lowValue, $highValue, $lowColour, $highColour = null, $tag = '', $label = '')
              Severity: Minor
              Found in lib/Weathermap/Core/ScaleEntry.php - About 45 mins to fix

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

                    public function hitTest($x, $y)
                    {
                        $c = false;
                        // do the easy bounding-box test first.
                        if (($x < $this->minx) || ($x > $this->maxx) || ($y < $this->miny) || ($y > $this->maxy)) {
                Severity: Minor
                Found in lib/Weathermap/Core/HTMLImagemapAreaPolygon.php - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                    public function findScaleHit($value)
                    {
                        $tag = '';
                        $smallestMatchColour = null;
                        $smallestMatchSize = null;
                Severity: Minor
                Found in lib/Weathermap/Core/MapScale.php - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                    public function prepareForDataCollection()
                    {
                        /** @var Target $target */
                        foreach ($this->targets as $target) {
                            MapUtility::debug("ProcessTargets: New Target: $target\n");
                Severity: Minor
                Found in lib/Weathermap/Core/MapDataItem.php - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                    private function drawArtificialIcon(&$map, $labelColour)
                    {
                        MapUtility::debug('Artificial Icon type ' . $this->iconfile . " for $this->name\n");
                        // this is an artificial icon - we don't load a file for it
                
                
                Severity: Minor
                Found in lib/Weathermap/Core/MapNode.php - About 45 mins to fix

                Cognitive Complexity

                Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                A method's cognitive complexity is based on a few simple rules:

                • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                • Code is considered more complex for each "break in the linear flow of the code"
                • Code is considered more complex when "flow breaking structures are nested"

                Further reading

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

                    public function drawImageString($gdImage, $x, $y, $string, $colour, $angle = 0)
                Severity: Minor
                Found in lib/Weathermap/Core/GDFont.php - About 45 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language