steeffeen/FancyManiaLinks

View on GitHub

Showing 2,233 of 2,233 total issues

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

    public function render($echo = false, $domDocument = null)
    {
        $isChild = (bool)$domDocument;
        if (!$isChild) {
            $domDocument                = new \DOMDocument("1.0", "utf-8");
Severity: Minor
Found in FML/ManiaLink.php - About 2 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 Paging.php has 278 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

namespace FML\Script\Features;

use FML\Controls\Control;
Severity: Minor
Found in FML/Script/Features/Paging.php - About 2 hrs to fix

    Method render has 66 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function render($echo = false, $domDocument = null)
        {
            $isChild = (bool)$domDocument;
            if (!$isChild) {
                $domDocument                = new \DOMDocument("1.0", "utf-8");
    Severity: Major
    Found in FML/ManiaLink.php - About 2 hrs to fix

      Script has 23 functions (exceeds 20 allowed). Consider refactoring.
      Open

      class Script
      {
      
          /*
           * Constants
      Severity: Minor
      Found in FML/Script/Script.php - About 2 hrs to fix

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

            public function render(\DOMDocument $domDocument)
            {
                $domElement = $domDocument->createElement($this->getTagName());
                if ($this->controlId) {
                    $domElement->setAttribute("id", $this->controlId);
        Severity: Minor
        Found in FML/Controls/Control.php - About 2 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 TMUIProperties.php has 261 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        namespace FML\XmlRpc;
        
        /**
        Severity: Minor
        Found in FML/XmlRpc/TMUIProperties.php - About 2 hrs to fix

          Function __construct has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              public function __construct($control = null, $keyNameOrCode = null, $rememberState = true)
              {
                  if ($control && !$control instanceof Control) {
                      // backwards-compatibility - control parameter has been introduced later on
                      $rememberState = $keyNameOrCode;
          Severity: Minor
          Found in FML/Script/Features/ToggleInterface.php - About 2 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 render has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              public function render(\DOMDocument $domDocument)
              {
                  $domElement = parent::render($domDocument);
                  if ($this->default !== null) {
                      $domElement->setAttribute("default", $this->default);
          Severity: Minor
          Found in FML/Controls/TextEdit.php - About 2 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 collect has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
          Open

              public static function collect()
              {
                  $params         = func_get_args();
                  $scriptFeatures = array();
                  foreach ($params as $object) {
          Severity: Minor
          Found in FML/Script/Features/ScriptFeature.php - About 2 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

          Audio has 21 functions (exceeds 20 allowed). Consider refactoring.
          Open

          class Audio extends Control implements Playable, Scriptable
          {
          
              /**
               * @var string $data Data url
          Severity: Minor
          Found in FML/Controls/Audio.php - About 2 hrs to fix

            Video has 21 functions (exceeds 20 allowed). Consider refactoring.
            Open

            class Video extends Control implements Playable, Scriptable
            {
            
                /**
                 * @var string $data Data url
            Severity: Minor
            Found in FML/Controls/Video.php - About 2 hrs to fix

              CustomUI has 21 functions (exceeds 20 allowed). Consider refactoring.
              Open

              class CustomUI
              {
              
                  /**
                   * @var bool $globalVisible If the UI should be shown at all
              Severity: Minor
              Found in FML/CustomUI.php - About 2 hrs to fix

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

                    public function render(\DOMDocument $domDocument)
                    {
                        $domElement = $domDocument->createElement("mood");
                        if ($this->lightAmbientColor) {
                            $domElement->setAttribute("LAmbient_LinearRgb", $this->lightAmbientColor);
                Severity: Minor
                Found in FML/Stylesheet/Mood.php - About 2 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 render has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function render(\DOMDocument $domDocument)
                    {
                        $domElement = parent::render($domDocument);
                        if ($this->default !== null) {
                            $domElement->setAttribute("default", $this->default);
                Severity: Major
                Found in FML/Controls/TextEdit.php - About 2 hrs to fix

                  Method render has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      public function render(\DOMDocument $domDocument)
                      {
                          $domElement = parent::render($domDocument);
                          if ($this->name) {
                              $domElement->setAttribute("name", $this->name);
                  Severity: Minor
                  Found in FML/Controls/Entry.php - About 2 hrs to fix

                    Method render has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        public function render(\DOMDocument $domDocument)
                        {
                            $domElement = $domDocument->createElement("mood");
                            if ($this->lightAmbientColor) {
                                $domElement->setAttribute("LAmbient_LinearRgb", $this->lightAmbientColor);
                    Severity: Minor
                    Found in FML/Stylesheet/Mood.php - About 1 hr to fix

                      Method render has 46 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          public function render(\DOMDocument $domDocument)
                          {
                              $domElement = $domDocument->createElement($this->getTagName());
                              if ($this->controlId) {
                                  $domElement->setAttribute("id", $this->controlId);
                      Severity: Minor
                      Found in FML/Controls/Control.php - About 1 hr to fix

                        Avoid excessively long variable names like $skyGradientKeyElement. Keep variable name length under 20.
                        Open

                                        $skyGradientKeyElement = $skyGradientKey->render($domDocument);
                        Severity: Minor
                        Found in FML/Stylesheet/Mood.php by phpmd

                        LongVariable

                        Since: 0.2

                        Detects when a field, formal or local variable is declared with a long name.

                        Example

                        class Something {
                            protected $reallyLongIntName = -3; // VIOLATION - Field
                            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                                $otherReallyLongName = -5; // VIOLATION - Local
                                for ($interestingIntIndex = 0; // VIOLATION - For
                                     $interestingIntIndex < 10;
                                     $interestingIntIndex++ ) {
                                }
                            }
                        }

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

                        Avoid excessively long variable names like $checkpointListProperties. Keep variable name length under 20.
                        Open

                            protected $checkpointListProperties = array();
                        Severity: Minor
                        Found in FML/XmlRpc/TMUIProperties.php by phpmd

                        LongVariable

                        Since: 0.2

                        Detects when a field, formal or local variable is declared with a long name.

                        Example

                        class Something {
                            protected $reallyLongIntName = -3; // VIOLATION - Field
                            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                                $otherReallyLongName = -5; // VIOLATION - Local
                                for ($interestingIntIndex = 0; // VIOLATION - For
                                     $interestingIntIndex < 10;
                                     $interestingIntIndex++ ) {
                                }
                            }
                        }

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

                        Avoid excessively long variable names like $scriptActionParameters. Keep variable name length under 20.
                        Open

                            public function setScriptActionParameters(array $scriptActionParameters = null)
                        Severity: Minor
                        Found in FML/Controls/Audio.php by phpmd

                        LongVariable

                        Since: 0.2

                        Detects when a field, formal or local variable is declared with a long name.

                        Example

                        class Something {
                            protected $reallyLongIntName = -3; // VIOLATION - Field
                            public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
                                $otherReallyLongName = -5; // VIOLATION - Local
                                for ($interestingIntIndex = 0; // VIOLATION - For
                                     $interestingIntIndex < 10;
                                     $interestingIntIndex++ ) {
                                }
                            }
                        }

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

                        Severity
                        Category
                        Status
                        Source
                        Language