rhosocial/yii2-organization

View on GitHub

Showing 816 of 816 total issues

Avoid excessively long variable names like $only_accept_superior_org_member. Keep variable name length under 20.
Open

    public $only_accept_superior_org_member;
Severity: Minor
Found in forms/SettingsForm.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $disallow_member_join_other. Keep variable name length under 20.
Open

    public $disallow_member_join_other;
Severity: Minor
Found in forms/SettingsForm.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $only_accept_current_org_member. Keep variable name length under 20.
Open

    public $only_accept_current_org_member;
Severity: Minor
Found in forms/SettingsForm.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $exclude_other_members. Keep variable name length under 20.
Open

    public $exclude_other_members;
Severity: Minor
Found in forms/SettingsForm.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $exit_allow_withdraw_actively. Keep variable name length under 20.
Open

    public $exit_allow_withdraw_actively;
Severity: Minor
Found in forms/SettingsForm.php by phpmd

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $assignAdminFailedMessage. Keep variable name length under 20.
Open

    public $assignAdminFailedMessage;

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $revokeAdminFailedMessage. Keep variable name length under 20.
Open

    public $revokeAdminFailedMessage;

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $assignAdminSuccessMessage. Keep variable name length under 20.
Open

    public $assignAdminSuccessMessage;

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Avoid excessively long variable names like $revokeAdminSuccessMessage. Keep variable name length under 20.
Open

    public $revokeAdminSuccessMessage;

LongVariable

Since: 0.2

Detects when a field, formal or local variable is declared with a long name.

Example

class Something {
    protected $reallyLongIntName = -3; // VIOLATION - Field
    public static function main( array $interestingArgumentsList[] ) { // VIOLATION - Formal
        $otherReallyLongName = -5; // VIOLATION - Local
        for ($interestingIntIndex = 0; // VIOLATION - For
             $interestingIntIndex < 10;
             $interestingIntIndex++ ) {
        }
    }
}

Source https://phpmd.org/rules/naming.html#longvariable

Method actions has 38 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function actions()
    {
        return [
            'index' => [
                'class' => 'rhosocial\organization\web\organization\controllers\my\IndexAction',
Severity: Minor
Found in web/organization/controllers/MyController.php - About 1 hr to fix

    The class Organization has 20 fields. Consider redesigning Organization to keep the number of fields under 15.
    Open

    class Organization extends User
    {
        use SelfBlameableTrait;
    
        const TYPE_ORGANIZATION = 1;
    Severity: Minor
    Found in Organization.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

    The class MemberSearch has 19 fields. Consider redesigning MemberSearch to keep the number of fields under 15.
    Open

    class MemberSearch extends Model
    {
        /**
         * @var Organization
         */
    Severity: Minor
    Found in MemberSearch.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

    The class OrganizationSearch has 16 fields. Consider redesigning OrganizationSearch to keep the number of fields under 15.
    Open

    class OrganizationSearch extends Model
    {
        public $organizationClass = Organization::class;
        public $memberClass = Member::class;
        public function getQuery()
    Severity: Minor
    Found in OrganizationSearch.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

    Method behaviors has 37 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function behaviors()
        {
            return [
                'access' => [
                    'class' => AccessControl::class,
    Severity: Minor
    Found in web/organization/controllers/MyController.php - About 1 hr to fix

      Method prepareQuery has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function prepareQuery($query = null)
          {
              if (!$query) {
                  $query = $this->getQuery();
              }
      Severity: Minor
      Found in OrganizationSearch.php - About 1 hr to fix

        Method revokeOrganization has 34 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function revokeOrganization($organization, $revokeIfHasChildren = true)
            {
                if (!($organization instanceof $this->organizationClass))
                {
                    $class = $this->organizationClass;
        Severity: Minor
        Found in UserOrganizationTrait.php - About 1 hr to fix

          Method attributeHints has 34 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              public function attributeHints()
              {
                  $topName = $this->organization->isDepartment() ? $this->organization->topOrganization->profile->name . ' (' . $this->organization->topOrganization->getID() . ')' : '';
                  $parentName = $this->organization->isDepartment() ? $this->organization->parent->profile->name . ' (' . $this->organization->parent->getID() . ')' : '';
                  return [
          Severity: Minor
          Found in forms/SettingsForm.php - About 1 hr to fix

            Method behaviors has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function behaviors()
                {
                    return [
                        'access' => [
                            'class' => AccessControl::class,
            Severity: Minor
            Found in web/user/controllers/OrganizationController.php - About 1 hr to fix

              Method submit has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function submit()
                  {
                      try {
                          if ($this->organization->isOrganization()) {
                              if ($this->exclude_other_members != ($this->organization->isExcludeOtherMembers ? '1' : '0')) {
              Severity: Minor
              Found in forms/SettingsForm.php - About 1 hr to fix

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

                class Organization extends User
                {
                    use SelfBlameableTrait;
                
                    const TYPE_ORGANIZATION = 1;
                Severity: Minor
                Found in Organization.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

                Severity
                Category
                Status
                Source
                Language