luyadev/luya-module-admin

View on GitHub

Showing 503 of 503 total issues

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

    public static function asyncRequest($ngModel, $label, $api, $fields, array $options = [])
Severity: Minor
Found in src/helpers/Angular.php - About 35 mins to fix

    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

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                              $http.get(url).then(function(response) {
                                  deferred.resolve(response);
                                  $scope.parseResponseQueryToListArray(response);
                              });
              Severity: Minor
              Found in src/resources/js/controllers.js and 1 other location - About 35 mins to fix
              src/resources/js/controllers.js on lines 787..790

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 47.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                              $http.get(url).then(function(response) {
                                  $scope.parseResponseQueryToListArray(response);
                                  deferred.resolve(response);
                              });
              Severity: Minor
              Found in src/resources/js/controllers.js and 1 other location - About 35 mins to fix
              src/resources/js/controllers.js on lines 780..783

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 47.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  public function onBeforeFind($event)
                  {
                      if (!$this->i18n) {
                          $this->writeAttribute($event, $this->jsonDecode($event->sender->getAttribute($this->name)));
                          if ($this->fileIterator) {
              Severity: Minor
              Found in src/ngrest/plugins/FileArray.php and 1 other location - About 35 mins to fix
              src/ngrest/plugins/ImageArray.php on lines 115..126

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 92.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Similar blocks of code found in 2 locations. Consider refactoring.
              Open

                  public function onBeforeFind($event)
                  {
                      if (!$this->i18n) {
                          $this->writeAttribute($event, $this->jsonDecode($event->sender->getAttribute($this->name)));
                          if ($this->imageIterator) {
              Severity: Minor
              Found in src/ngrest/plugins/ImageArray.php and 1 other location - About 35 mins to fix
              src/ngrest/plugins/FileArray.php on lines 100..111

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 92.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              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

              Severity
              Category
              Status
              Source
              Language