halfpastfouram/PHPChartJS

View on GitHub
src/Options/Scale.php

Summary

Maintainability
C
1 day
Test Coverage

Scale has 47 functions (exceeds 20 allowed). Consider refactoring.
Open

abstract class Scale implements ArraySerializableInterface, JsonSerializable
{
    use ArraySerializable;

    /**
Severity: Minor
Found in src/Options/Scale.php - About 6 hrs to fix

    The class Scale has an overall complexity of 50 which is very high. The configured complexity threshold is 50.
    Open

    abstract class Scale implements ArraySerializableInterface, JsonSerializable
    {
        use ArraySerializable;
    
        /**
    Severity: Minor
    Found in src/Options/Scale.php by phpmd

    File Scale.php has 252 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace Halfpastfour\PHPChartJS\Options;
    
    use Halfpastfour\PHPChartJS\ArraySerializableInterface;
    Severity: Minor
    Found in src/Options/Scale.php - About 2 hrs to fix

      The class Scale has 47 public methods and attributes. Consider reducing the number of public items to less than 45.
      Open

      abstract class Scale implements ArraySerializableInterface, JsonSerializable
      {
          use ArraySerializable;
      
          /**
      Severity: Minor
      Found in src/Options/Scale.php by phpmd

      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

          protected $id;
      Severity: Minor
      Found in src/Options/Scale.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 $id. Configured minimum length is 3.
      Wontfix

          public function setId($id)
      Severity: Minor
      Found in src/Options/Scale.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

      There are no issues that match your filters.

      Category
      Status