luyadev/luya-module-admin

View on GitHub

Showing 331 of 503 total issues

Method injector has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

    protected static function injector($type, $ngModel, $label, $options = [], array $mergeOptions = [])
Severity: Minor
Found in src/helpers/Angular.php - About 35 mins to fix

    Method generateModelContent has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

        public function generateModelContent($fileNamepsace, $className, $apiEndpoint, TableSchema $schema, $i18nFields)
    Severity: Minor
    Found in src/commands/CrudController.php - About 35 mins to fix

      Method itemRoute has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

          public function itemRoute($name, $route, $icon, $searchModelClass = null, array $options = [])
      Severity: Minor
      Found in src/components/AdminMenuBuilder.php - About 35 mins to fix

        Method lock has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            public static function lock($userId, $table, $pk, $translation, array $translationArgs = [])
        Severity: Minor
        Found in src/models/UserOnline.php - About 35 mins to fix

          Method sendArray has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

              private function sendArray($refresh, array $errors = [], $enterSecureToken = false, $message = null, $enterTwoFaToken = false)
          Severity: Minor
          Found in src/controllers/LoginController.php - About 35 mins to fix

            Function getDataInstance has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                private static function getDataInstance(ActiveQuery $query)
                {
                    $class = $query->modelClass;
            
                    $keys = [$class];
            Severity: Minor
            Found in src/ngrest/plugins/SelectModel.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function actionRelationCall has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function actionRelationCall($arrayIndex, $id, $modelClass, $query = null)
                {
                    $modelClass = base64_decode($modelClass);
            
                    if (!class_exists($modelClass)) {
            Severity: Minor
            Found in src/ngrest/base/Api.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function processThumbnails has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function processThumbnails()
                {
                    foreach ($this->findFiles(['is_hidden' => false, 'is_deleted' => false]) as $file) {
                        if ($file->isImage) {
                            // create tiny thumbnail
            Severity: Minor
            Found in src/storage/BaseFileSystemStorage.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function renderElementPlugins has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function renderElementPlugins($configContext, $typeConfig, $uniqueId, $attribute, $ngRestModel, $label, $elmni18n)
                {
                    $args = $typeConfig['args'];
                    $args['renderContext'] = $this;
                    $obj = NgRest::createPluginObject($typeConfig['class'], $attribute, $label, $elmni18n, $args);
            Severity: Minor
            Found in src/ngrest/render/RenderCrud.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function onFinish has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function onFinish()
                {
                    foreach ($this->getPrimaryKey() as $pk) {
                        if (!$this->hasField('list', $pk)) {
                            $alias = $pk;
            Severity: Minor
            Found in src/ngrest/Config.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function ngRestConfigButtonCondition has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                private function ngRestConfigButtonCondition($arrayConfig)
                {
                    if (!isset($arrayConfig[2]) || !isset($arrayConfig[2]['buttonCondition'])) {
                        $buttonCondition = '';
                    } elseif (is_string($arrayConfig[2]['buttonCondition'])) {
            Severity: Minor
            Found in src/ngrest/base/NgRestModel.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function syncDataInternal has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                private function syncDataInternal()
                {
                    Console::startProgress(0, $this->getOffsetTotal(), 'Fetch: ' . $this->getName() . ' ');
                    $this->_contentRowsCount = 0;
            
            
            Severity: Minor
            Found in src/proxy/ClientTable.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function getAvailableApiEndpoints has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                protected function getAvailableApiEndpoints()
                {
                    $data = [];
                    $generic = [];
                    $userId = $this->model->id;
            Severity: Minor
            Found in src/aws/ApiOverviewActiveWindow.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function actionAsyncToken has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function actionAsyncToken()
                {
                    if (($lockout = $this->sessionBruteForceLock(Yii::$app->session->get('secureId')))) {
                        return $this->sendArray(false, [Module::t('login_async_submission_limit_reached', ['time' =>  Yii::$app->formatter->asRelativeTime($lockout)])]);
                    }
            Severity: Minor
            Found in src/controllers/LoginController.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function isActionAllowed has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function isActionAllowed($action)
                {
                    if ($this->isActionAuthOptional($action)) {
                        return true;
                    }
            Severity: Minor
            Found in src/base/RestActiveController.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function actionIndex has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function actionIndex($identifier, $token)
                {
                    $machine = ProxyMachine::findOne(['identifier' => $identifier, 'is_deleted' => false]);
            
                    if (!$machine) {
            Severity: Minor
            Found in src/apis/ProxyController.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function actionSessionUpdate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function actionSessionUpdate()
                {
                    $identity = Yii::$app->adminuser->identity;
                    $user = clone Yii::$app->adminuser->identity;
                    $user->attributes = Yii::$app->request->bodyParams;
            Severity: Minor
            Found in src/apis/UserController.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function getItems has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getItems()
                {
                    if ($this->_items !== null) {
                        return $this->_items;
                    }
            Severity: Minor
            Found in src/components/AdminMenu.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function beforeAction has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function beforeAction($action)
                {
                    if (parent::beforeAction($action)) {
                        if ($this->isActionAuthOptional($action->id)) {
                            return true;
            Severity: Minor
            Found in src/base/RestController.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Function actionPasswordReset has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
            Open

                public function actionPasswordReset($token, $id)
                {
                    if (!$this->module->resetPassword) {
                        throw new ForbiddenHttpException();
                    }
            Severity: Minor
            Found in src/controllers/LoginController.php - About 35 mins to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            Severity
            Category
            Status
            Source
            Language