luyadev/luya-module-admin

View on GitHub

Showing 331 of 503 total issues

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

    public function callbackUpload()
    {
        $config = new Config();
        $config->setTempDir($this->getTempFolder());
        $file = new File($config);
Severity: Minor
Found in src/aws/FlowActiveWindow.php - About 1 hr to fix

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

        public function actionAsync()
        {
            if (($lockout = $this->sessionBruteForceLock(0))) {
                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 1 hr to fix

      Function addFile has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function addFile($fileSource, $fileName, $folderId = 0, $isHidden = false)
          {
              // ensure the file upload
              $fileData = $this->ensureFileUpload($fileSource, $fileName);
              // generate md5 hash from file source
      Severity: Minor
      Found in src/storage/BaseFileSystemStorage.php - About 1 hr 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 formatExportValues has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          private function formatExportValues(ActiveQuery $query, array $formatter)
          {
              Yii::$app->formatter->nullDisplay = '';
              $data = [];
              $rowId = 0;
      Severity: Minor
      Found in src/ngrest/base/Api.php - About 1 hr 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 ngRestConfig has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function ngRestConfig($config)
          {
              foreach ($this->ngRestScopes() as $arrayConfig) {
                  if (!isset($arrayConfig[0]) && !isset($arrayConfig[1])) {
                      throw new InvalidConfigException("Invalid ngRestScope definition. Definition must contain an array with two elements: `['create', []]`");
      Severity: Minor
      Found in src/ngrest/base/NgRestModel.php - About 1 hr 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 extractFilesDataFromMultipleFiles has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function extractFilesDataFromMultipleFiles(array $files)
          {
              $data = [];
              $i = 0;
              foreach ($files as $type => $field) {
      Severity: Minor
      Found in src/helpers/Storage.php - About 1 hr 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 getActiveLanguage has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getActiveLanguage()
          {
              if ($this->_activeLanguage === null) {
                  if ($this->activeShortCodeCallable && is_callable($this->activeShortCodeCallable)) {
                      $langShortCode = call_user_func($this->activeShortCodeCallable, $this);
      Severity: Minor
      Found in src/components/AdminLanguage.php - About 1 hr 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 extractFilesDataFromFilesArray has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public static function extractFilesDataFromFilesArray(array $file)
          {
              if (!isset($file['tmp_name'])) {
                  return [];
              }
      Severity: Minor
      Found in src/helpers/Storage.php - About 1 hr 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 actionFixTableNames has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function actionFixTableNames()
          {
              $batch = TagRelation::find()->batch();
              $i = 0;
              $fixed = 0;
      Severity: Minor
      Found in src/commands/TagController.php - About 1 hr 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 validatePassword has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function validatePassword($attribute)
          {
              if (!$this->hasErrors()) {
                  $user = $this->getUser();
      
      
      Severity: Minor
      Found in src/models/LoginForm.php - About 1 hr 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 run has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function run()
          {
              $this->refresh('thumbnail', [
                  'name' => 'Thumbnail',
                  'imagine_name' => 'thumbnail',
      Severity: Minor
      Found in src/importers/FilterImporter.php - About 1 hr 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 getParameters has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
      Open

          public function getParameters(): array
          {
              $params = [];
              if ($this->getReflection() instanceof ReflectionMethod) {
                  foreach ($this->getReflection()->getParameters() as $arg) {
      Severity: Minor
      Found in src/openapi/specs/BaseSpecs.php - About 1 hr 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 template has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

              template: function () {
                  return '' +
                      '<div class="form-group form-side-by-side" ng-class="{\'input--hide-label\': i18n}">' +
                      '<div class="form-side form-side-label">' +
                      '<label>{{label}}</label>' +
      Severity: Minor
      Found in src/resources/js/formdirectives.js - About 1 hr to fix

        Method getAngularControllerConfig has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function getAngularControllerConfig()
            {
                return [
                    'apiListQueryString' => $this->context->apiQueryString('list'),
                    'apiUpdateQueryString' => $this->context->apiQueryString('update'),
        Severity: Minor
        Found in src/ngrest/render/RenderCrudView.php - About 1 hr to fix

          Method actionRelationCall has 31 lines of code (exceeds 25 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 1 hr to fix

            Method onListFind has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function onListFind($event)
                {
                    // async list ignores the onListFind event
                    if ($this->asyncList) {
                        return;
            Severity: Minor
            Found in src/ngrest/plugins/SelectRelationActiveQuery.php - About 1 hr to fix

              Function template has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      template: function () {
                          return '' +
                              '<div class="form-group form-side-by-side zaa-datetime" ng-class="{\'input--hide-label\': i18n, \'input--with-time\': model!=null && date!=null}">' +
                              '<div class="form-side form-side-label">' +
                              '<label>{{label}}</label>' +
              Severity: Minor
              Found in src/resources/js/formdirectives.js - About 1 hr to fix

                Method startFiles has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function startFiles()
                    {
                        $fileCount = 0;
                        // sync files
                        foreach ((new Query())->where(['is_deleted' => false])->all() as $file) {
                Severity: Minor
                Found in src/proxy/ClientTransfer.php - About 1 hr to fix

                  Function success has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              success: function (response) {
                                  $('.login-btn[type="submit"]').attr('disabled', false);
                                  $('.login-spinner').hide();
                                  $('.login-btn-label').show();
                                  var refresh = response['refresh'];
                  Severity: Minor
                  Found in src/resources/js/login.js - About 1 hr to fix

                    Function onTyping has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                                thisInput.on('keyup blur', function onTyping() {
                    
                                  if (thisInput[0].value &&
                                    thisInput[0].value.length &&
                                    thisInput[0].value.length > 0) {
                    Severity: Minor
                    Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language