steeffeen/FancyManiaLinks

View on GitHub

Showing 2,233 of 2,233 total issues

Function addScriptFeature has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public static function addScriptFeature(array $scriptFeatures, $newScriptFeatures)
    {
        if (!$newScriptFeatures) {
            return $scriptFeatures;
        }
Severity: Minor
Found in FML/Script/Features/ScriptFeature.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 render has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function render(\DOMDocument $domDocument)
    {
        $domElement = parent::render($domDocument);
        if ($this->data) {
            $domElement->setAttribute("data", $this->data);
Severity: Minor
Found in FML/Controls/Video.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 render has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
Open

    public function render(\DOMDocument $domDocument)
    {
        $domElement = parent::render($domDocument);
        if ($this->data) {
            $domElement->setAttribute("data", $this->data);
Severity: Minor
Found in FML/Controls/Audio.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 buildUpdatePickerValueFunction has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function buildUpdatePickerValueFunction()
    {
        return "
Void " . self::FUNCTION_UPDATE_PICKER_VALUE . "(CMlLabel _Label) {
    declare " . self::VAR_PICKER_VALUES . " as Values for _Label = Text[Integer];
Severity: Minor
Found in FML/Script/Features/ValuePickerFeature.php - About 1 hr to fix

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

        protected function buildUpdateQuadDesignFunction()
        {
            return "
    Void " . self::FUNCTION_UPDATE_QUAD_DESIGN . "(CMlQuad _Quad) {
        declare " . self::VAR_CHECKBOX_ENABLED . " as Enabled for _Quad = True;
    Severity: Minor
    Found in FML/Script/Features/CheckBoxFeature.php - About 1 hr to fix

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

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

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

            public function render(\DOMDocument $domDocument)
            {
                $domElement = $domDocument->createElement("format");
                if ($this->backgroundColor) {
                    $domElement->setAttribute("bgcolor", $this->backgroundColor);
        Severity: Minor
        Found in FML/Elements/Format.php - About 1 hr to fix

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

          <?php
          
          namespace FML\Controls\Quads;
          
          use FML\Controls\Quad;
          Severity: Minor
          Found in FML/Controls/Quads/Quad_UIConstruction_Buttons2.php and 1 other location - About 1 hr to fix
          FML/Controls/Quads/Quad_Copilot.php on lines 1..39

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

          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

          <?php
          
          namespace FML\Controls\Quads;
          
          use FML\Controls\Quad;
          Severity: Minor
          Found in FML/Controls/Quads/Quad_Copilot.php and 1 other location - About 1 hr to fix
          FML/Controls/Quads/Quad_UIConstruction_Buttons2.php on lines 1..39

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

          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

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

              public function __construct($maniaLinkId = null, $version = null, $name = null, array $children = null)
              {
                  if (is_string($version) && (!$name || is_array($name)) && !$children) {
                      // backwards-compatibility (version has been introduced later, if it's a string it's supposed to be the name)
                      $children = $name;
          Severity: Minor
          Found in FML/ManiaLink.php - About 55 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

          The class Label_Text is not named in CamelCase.
          Open

          class Label_Text extends Label
          {
          
              /*
               * Constants
          Severity: Minor
          Found in FML/Controls/Labels/Label_Text.php by phpmd

          CamelCaseClassName

          Since: 0.2

          It is considered best practice to use the CamelCase notation to name classes.

          Example

          class class_name {
          }

          Source

          The class Quad_BgRaceScore2 is not named in CamelCase.
          Open

          class Quad_BgRaceScore2 extends Quad
          {
          
              /*
               * Constants

          CamelCaseClassName

          Since: 0.2

          It is considered best practice to use the CamelCase notation to name classes.

          Example

          class class_name {
          }

          Source

          The class Quad_Emblems is not named in CamelCase.
          Open

          class Quad_Emblems extends Quad
          {
          
              /*
               * Constants
          Severity: Minor
          Found in FML/Controls/Quads/Quad_Emblems.php by phpmd

          CamelCaseClassName

          Since: 0.2

          It is considered best practice to use the CamelCase notation to name classes.

          Example

          class class_name {
          }

          Source

          Avoid variables with short names like $x. Configured minimum length is 3.
          Open

              public static function create($x = null, $color = null)
          Severity: Minor
          Found in FML/Stylesheet/SkyGradientKey.php by phpmd

          ShortVariable

          Since: 0.2

          Detects when a field, local, or parameter has a very short name.

          Example

          class Something {
              private $q = 15; // VIOLATION - Field
              public static function main( array $as ) { // VIOLATION - Formal
                  $r = 20 + $this->q; // VIOLATION - Local
                  for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                      $r += $this->q;
                  }
              }
          }

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

          Avoid variables with short names like $x. Configured minimum length is 3.
          Open

              public function __construct($x = null, $color = null)
          Severity: Minor
          Found in FML/Stylesheet/SkyGradientKey.php by phpmd

          ShortVariable

          Since: 0.2

          Detects when a field, local, or parameter has a very short name.

          Example

          class Something {
              private $q = 15; // VIOLATION - Field
              public static function main( array $as ) { // VIOLATION - Formal
                  $r = 20 + $this->q; // VIOLATION - Local
                  for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                      $r += $this->q;
                  }
              }
          }

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

          The class Quad_321Go is not named in CamelCase.
          Open

          class Quad_321Go extends Quad
          {
          
              /*
               * Constants
          Severity: Minor
          Found in FML/Controls/Quads/Quad_321Go.php by phpmd

          CamelCaseClassName

          Since: 0.2

          It is considered best practice to use the CamelCase notation to name classes.

          Example

          class class_name {
          }

          Source

          The class Label_Button is not named in CamelCase.
          Open

          class Label_Button extends Label
          {
          
              /*
               * Constants
          Severity: Minor
          Found in FML/Controls/Labels/Label_Button.php by phpmd

          CamelCaseClassName

          Since: 0.2

          It is considered best practice to use the CamelCase notation to name classes.

          Example

          class class_name {
          }

          Source

          The class Quad_Icons128x128_Blink is not named in CamelCase.
          Open

          class Quad_Icons128x128_Blink extends Quad
          {
          
              /*
               * Constants

          CamelCaseClassName

          Since: 0.2

          It is considered best practice to use the CamelCase notation to name classes.

          Example

          class class_name {
          }

          Source

          Avoid variables with short names like $x. Configured minimum length is 3.
          Open

              protected $x = null;
          Severity: Minor
          Found in FML/Stylesheet/SkyGradientKey.php by phpmd

          ShortVariable

          Since: 0.2

          Detects when a field, local, or parameter has a very short name.

          Example

          class Something {
              private $q = 15; // VIOLATION - Field
              public static function main( array $as ) { // VIOLATION - Formal
                  $r = 20 + $this->q; // VIOLATION - Local
                  for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                      $r += $this->q;
                  }
              }
          }

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

          Avoid variables with short names like $x. Configured minimum length is 3.
          Open

              public function setX($x)
          Severity: Minor
          Found in FML/Stylesheet/SkyGradientKey.php by phpmd

          ShortVariable

          Since: 0.2

          Detects when a field, local, or parameter has a very short name.

          Example

          class Something {
              private $q = 15; // VIOLATION - Field
              public static function main( array $as ) { // VIOLATION - Formal
                  $r = 20 + $this->q; // VIOLATION - Local
                  for (int $i = 0; $i < 10; $i++) { // Not a Violation (inside FOR)
                      $r += $this->q;
                  }
              }
          }

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

          Severity
          Category
          Status
          Source
          Language