yiisoft/yii2

View on GitHub

Showing 172 of 2,465 total issues

Consider simplifying this complex logical expression.
Open

            if (
                $rule === '*'
                || $rule === $ip
                || (
                    $ip !== null
Severity: Major
Found in framework/filters/AccessRule.php - About 1 hr to fix

    Consider simplifying this complex logical expression.
    Open

                    if ($associative && isset($params[$name]) && $params[$name] instanceof $className) {
                        $args[] = $params[$name];
                        unset($params[$name]);
                    } elseif (!$associative && isset($params[0]) && $params[0] instanceof $className) {
                        $args[] = array_shift($params);
    Severity: Major
    Found in framework/di/Container.php - About 1 hr to fix

      Method loadFilesRecursive has 8 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          private static function loadFilesRecursive($key, $names, $tempNames, $types, $sizes, $errors, $fullPaths, $tempResources)
      Severity: Major
      Found in framework/web/UploadedFile.php - About 1 hr to fix

        Method saveMessagesCategoryToPHP has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            protected function saveMessagesCategoryToPHP($messages, $fileName, $overwrite, $removeUnused, $sort, $category, $markUnused)
        Severity: Major
        Found in framework/console/controllers/MessageController.php - About 50 mins to fix

          Method saveMessagesToPO has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              protected function saveMessagesToPO($messages, $dirName, $overwrite, $removeUnused, $sort, $catalog, $markUnused)
          Severity: Major
          Found in framework/console/controllers/MessageController.php - About 50 mins to fix

            Method saveMessagesToDb has 7 arguments (exceeds 4 allowed). Consider refactoring.
            Open

                protected function saveMessagesToDb($messages, $db, $sourceMessageTable, $messageTable, $removeUnused, $languages, $markUnused)
            Severity: Major
            Found in framework/console/controllers/MessageController.php - About 50 mins to fix

              Method addForeignKey has 7 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                  public function addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = null, $update = null)
              Severity: Major
              Found in framework/db/oci/QueryBuilder.php - About 50 mins to fix

                Method addForeignKey has 7 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    public function addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = null, $update = null)
                Severity: Major
                Found in framework/db/Command.php - About 50 mins to fix

                  Method addForeignKey has 7 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = null, $update = null)
                  Severity: Major
                  Found in framework/db/QueryBuilder.php - About 50 mins to fix

                    Method addForeignKey has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                        public function addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = null, $update = null)
                    Severity: Major
                    Found in framework/db/Migration.php - About 50 mins to fix

                      Method addForeignKey has 7 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                          public function addForeignKey($name, $table, $columns, $refTable, $refColumns, $delete = null, $update = null)
                      Severity: Major
                      Found in framework/db/sqlite/QueryBuilder.php - About 50 mins to fix

                        Avoid deeply nested control flow statements.
                        Open

                                                    if (in_array($previousToken, [T_OBJECT_OPERATOR, T_PAAMAYIM_NEKUDOTAYIM], true)) {
                                                        $matchedTokensCount = 0;
                                                        continue;
                                                    }
                        Severity: Major
                        Found in framework/console/controllers/MessageController.php - About 45 mins to fix

                          Avoid deeply nested control flow statements.
                          Open

                                                  if (!@rmdir($fullPath)) {
                                                      $error = error_get_last();
                                                      Yii::warning("Unable to remove directory '{$fullPath}': {$error['message']}", __METHOD__);
                                                  }
                          Severity: Major
                          Found in framework/caching/FileCache.php - About 45 mins to fix

                            Avoid deeply nested control flow statements.
                            Open

                                                    if ($oneUp === 10) {
                                                        $oneUp = 0;
                                                        $carry = 1;
                                                    }
                            Severity: Major
                            Found in framework/i18n/Formatter.php - About 45 mins to fix

                              Avoid deeply nested control flow statements.
                              Open

                                                      if ($carry === 0) {
                                                          break;
                                                      }
                              Severity: Major
                              Found in framework/i18n/Formatter.php - About 45 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                        if ($this->matchAction($action)
                                            && $this->matchRole($user)
                                            && $this->matchIP($request->getUserIP())
                                            && $this->matchVerb($request->getMethod())
                                            && $this->matchController($action->controller)
                                Severity: Major
                                Found in framework/filters/AccessRule.php - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                              if (isset($_SERVER['SCRIPT_NAME']) && basename($_SERVER['SCRIPT_NAME']) === $scriptName) {
                                                  $this->_scriptUrl = $_SERVER['SCRIPT_NAME'];
                                              } elseif (isset($_SERVER['PHP_SELF']) && basename($_SERVER['PHP_SELF']) === $scriptName) {
                                                  $this->_scriptUrl = $_SERVER['PHP_SELF'];
                                              } elseif (isset($_SERVER['ORIG_SCRIPT_NAME']) && basename($_SERVER['ORIG_SCRIPT_NAME']) === $scriptName) {
                                  Severity: Major
                                  Found in framework/web/Request.php - About 40 mins to fix

                                    Consider simplifying this complex logical expression.
                                    Open

                                                    if ($isArray) {
                                                        $params[$name] = (array)$params[$name];
                                                    } elseif (is_array($params[$name])) {
                                                        $isValid = false;
                                                    } elseif (
                                    Severity: Major
                                    Found in framework/web/Controller.php - About 40 mins to fix

                                      Consider simplifying this complex logical expression.
                                      Open

                                              if ($date === false || ($errors !== false && ($errors['error_count'] || $errors['warning_count'])) || ($this->strictDateFormat && $date->format($format) !== $value)) {
                                                  return false;
                                              }
                                      Severity: Major
                                      Found in framework/validators/DateValidator.php - About 40 mins to fix

                                        Consider simplifying this complex logical expression.
                                        Open

                                                    if ($checkDateTimeInfo) {
                                                        $timestamp = new DateTime($value, new DateTimeZone($this->defaultTimeZone));
                                                        $info = date_parse($value);
                                                        return [
                                                            $timestamp,
                                        Severity: Major
                                        Found in framework/i18n/Formatter.php - About 40 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language