dcb9/yii2-qiniu

View on GitHub

Showing 63 of 63 total issues

QiniuAdapter has 38 functions (exceeds 20 allowed). Consider refactoring.
Open

class QiniuAdapter extends AbstractAdapter implements Configurable
{
    public static function className()
    {
        return get_called_class();
Severity: Minor
Found in src/QiniuAdapter.php - About 5 hrs to fix

    The class QiniuAdapter has 17 public methods. Consider refactoring QiniuAdapter to keep number of public methods under 10.
    Open

    class QiniuAdapter extends AbstractAdapter implements Configurable
    {
        public static function className()
        {
            return get_called_class();
    Severity: Minor
    Found in src/QiniuAdapter.php by phpmd

    TooManyPublicMethods

    Since: 0.1

    A class with too many public methods is probably a good suspect for refactoring, in order to reduce its complexity and find a way to have more fine grained objects.

    By default it ignores methods starting with 'get' or 'set'.

    Example

    Source https://phpmd.org/rules/codesize.html#toomanypublicmethods

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

    class QiniuAdapter extends AbstractAdapter implements Configurable
    {
        public static function className()
        {
            return get_called_class();
    Severity: Minor
    Found in src/QiniuAdapter.php by phpmd

    File QiniuAdapter.php has 295 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace dcb9\qiniu;
    
    use Qiniu\Zone;
    Severity: Minor
    Found in src/QiniuAdapter.php - About 3 hrs to fix

      The class Pfop has 29 fields. Consider redesigning Pfop to keep the number of fields under 15.
      Open

      class Pfop
      {
          private function __construct()
          {
          }
      Severity: Minor
      Found in src/Pfop.php by phpmd

      TooManyFields

      Since: 0.1

      Classes that have too many fields could be redesigned to have fewer fields, possibly through some nested object grouping of some of the information. For example, a class with city/state/zip fields could instead have one Address field.

      Example

      class Person {
         protected $one;
         private $two;
         private $three;
         [... many more fields ...]
      }

      Source https://phpmd.org/rules/codesize.html#toomanyfields

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class Yii extends \yii\BaseYii
      Severity: Minor
      Found in Yii.php by phpcodesniffer

      Each class must be in a namespace of at least one level (a top-level vendor name)
      Open

      class ConsoleApplication extends yii\console\Application
      Severity: Minor
      Found in Yii.php by phpcodesniffer

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

          protected $r;
      Severity: Minor
      Found in src/Pfop.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 $t. Configured minimum length is 3.
      Open

          protected $t;
      Severity: Minor
      Found in src/Pfop.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.
      Open

          public function setDisk($id, array $definition)
      Severity: Minor
      Found in src/Component.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 $vn. Configured minimum length is 3.
      Open

          protected $vn;
      Severity: Minor
      Found in src/Pfop.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 $h. Configured minimum length is 3.
      Open

          public function aspect($w, $h)
      Severity: Minor
      Found in src/Pfop.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 property $_disks is not named in camelCase.
      Open

      class Component extends \yii\base\Component
      {
          public $accessKey;
          public $secretKey;
      
      
      Severity: Minor
      Found in src/Component.php by phpmd

      CamelCasePropertyName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name attributes.

      Example

      class ClassName {
          protected $property_name;
      }

      Source

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

          public function aspect($w, $h)
      Severity: Minor
      Found in src/Pfop.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 property $_auth is not named in camelCase.
      Open

      class QiniuAdapter extends AbstractAdapter implements Configurable
      {
          public static function className()
          {
              return get_called_class();
      Severity: Minor
      Found in src/QiniuAdapter.php by phpmd

      CamelCasePropertyName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name attributes.

      Example

      class ClassName {
          protected $property_name;
      }

      Source

      The property $_bucketManager is not named in camelCase.
      Open

      class QiniuAdapter extends AbstractAdapter implements Configurable
      {
          public static function className()
          {
              return get_called_class();
      Severity: Minor
      Found in src/QiniuAdapter.php by phpmd

      CamelCasePropertyName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name attributes.

      Example

      class ClassName {
          protected $property_name;
      }

      Source

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

          protected $s;
      Severity: Minor
      Found in src/Pfop.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.
      Open

          public function getDisk($id)
      Severity: Minor
      Found in src/Component.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 $ss. Configured minimum length is 3.
      Open

          protected $ss;
      Severity: Minor
      Found in src/Pfop.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 property $_uploadManager is not named in camelCase.
      Open

      class QiniuAdapter extends AbstractAdapter implements Configurable
      {
          public static function className()
          {
              return get_called_class();
      Severity: Minor
      Found in src/QiniuAdapter.php by phpmd

      CamelCasePropertyName

      Since: 0.2

      It is considered best practice to use the camelCase notation to name attributes.

      Example

      class ClassName {
          protected $property_name;
      }

      Source

      Severity
      Category
      Status
      Source
      Language