lib/Weathermap/Core/ScaleEntry.php
Method asConfig
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function asConfig($scaleName, $kilo, $decimalPoint)
{
$output = "";
$top = rtrim(
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
public function __construct($lowValue, $highValue, $lowColour, $highColour = null, $tag = '', $label = '')
Rename "$top" which has the same name as the field declared at line 12. Open
Open
$top = rtrim(
- Read upRead up
- Exclude checks
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
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Rename "$tag" which has the same name as the field declared at line 15. Open
Open
$tag = (isset($this->tag) ? $this->tag : '');
- Read upRead up
- Exclude checks
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
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes
Rename "$bottom" which has the same name as the field declared at line 13. Open
Open
$bottom = rtrim(
- Read upRead up
- Exclude checks
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
- CERT, DCL51-J. - Do not shadow or obscure identifiers in subscopes