src/Options/Scale.php
Scale
has 47 functions (exceeds 20 allowed). Consider refactoring. Open
Open
abstract class Scale implements ArraySerializableInterface, JsonSerializable
{
use ArraySerializable;
/**
The class Scale has an overall complexity of 50 which is very high. The configured complexity threshold is 50. Open
Open
abstract class Scale implements ArraySerializableInterface, JsonSerializable
{
use ArraySerializable;
/**
- Exclude checks
File Scale.php
has 252 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
<?php
namespace Halfpastfour\PHPChartJS\Options;
use Halfpastfour\PHPChartJS\ArraySerializableInterface;
The class Scale has 47 public methods and attributes. Consider reducing the number of public items to less than 45. Open
Open
abstract class Scale implements ArraySerializableInterface, JsonSerializable
{
use ArraySerializable;
/**
- Read upRead up
- Exclude checks
ExcessivePublicCount
Since: 0.1
A large number of public methods and attributes declared in a class can indicate the class may need to be broken up as increased effort will be required to thoroughly test it.
Example
public class Foo {
public $value;
public $something;
public $var;
// [... more more public attributes ...]
public function doWork() {}
public function doMoreWork() {}
public function doWorkAgain() {}
// [... more more public methods ...]
}
Source https://phpmd.org/rules/codesize.html#excessivepubliccount
Avoid variables with short names like $id. Configured minimum length is 3. Wontfix
Wontfix
protected $id;
- Read upRead up
- Exclude checks
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 $id. Configured minimum length is 3. Wontfix
Wontfix
public function setId($id)
- Read upRead up
- Exclude checks
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;
}
}
}