howardjones/network-weathermap

View on GitHub
lib/Weathermap/Core/ScaleEntry.php

Summary

Maintainability
A
2 hrs
Test Coverage

Method asConfig has 43 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function asConfig($scaleName, $kilo, $decimalPoint)
    {
        $output = "";

        $top = rtrim(
Severity: Minor
Found in lib/Weathermap/Core/ScaleEntry.php - About 1 hr 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

      Rename "$top" which has the same name as the field declared at line 12.
      Open

              $top = rtrim(

      Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

      Noncompliant Code Example

      class Foo {
        public $myField;
      
        public function doSomething() {
          $myField = 0;
          ...
        }
      }
      

      See

      Rename "$bottom" which has the same name as the field declared at line 13.
      Open

              $bottom = rtrim(

      Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

      Noncompliant Code Example

      class Foo {
        public $myField;
      
        public function doSomething() {
          $myField = 0;
          ...
        }
      }
      

      See

      Rename "$tag" which has the same name as the field declared at line 15.
      Open

              $tag = (isset($this->tag) ? $this->tag : '');

      Shadowing fields with a local variable is a bad practice that reduces code readability: it makes it confusing to know whether the field or the variable is being used.

      Noncompliant Code Example

      class Foo {
        public $myField;
      
        public function doSomething() {
          $myField = 0;
          ...
        }
      }
      

      See

      There are no issues that match your filters.

      Category
      Status