luyadev/luya-module-admin

View on GitHub

Showing 331 of 503 total issues

User has 41 functions (exceeds 20 allowed). Consider refactoring.
Open

class User extends NgRestModel implements IdentityInterface, ChangePasswordInterface
{
    use SoftDeleteTrait;
    public const USER_SETTING_ISDEVELOPER = 'isDeveloper';

Severity: Minor
Found in src/models/User.php - About 5 hrs to fix

    File services.js has 394 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    // service resolver
    adminServiceResolver = ['ServiceFoldersData', 'ServiceFiltersData', 'ServiceLanguagesData', 'ServicePropertiesData', 'AdminLangService', 'ServiceFoldersDirectoryId', function(ServiceFoldersData, ServiceFiltersData, ServiceLanguagesData, ServicePropertiesData, AdminLangService, ServiceFoldersDirectoryId) {
        ServiceFiltersData.load();
        ServiceFoldersData.load();
        ServiceLanguagesData.load();
    Severity: Minor
    Found in src/resources/js/services.js - About 5 hrs to fix

      BaseFileSystemStorage has 40 functions (exceeds 20 allowed). Consider refactoring.
      Open

      abstract class BaseFileSystemStorage extends Component
      {
          use CacheableTrait;
      
          /**
      Severity: Minor
      Found in src/storage/BaseFileSystemStorage.php - About 5 hrs to fix

        Plugin has 39 functions (exceeds 20 allowed). Consider refactoring.
        Open

        abstract class Plugin extends Component implements TypesInterface
        {
            public const CREATE_CONTEXT_PREFIX = 'create.';
        
            public const UPDATE_CONTEXT_RPEFXI = 'update.';
        Severity: Minor
        Found in src/ngrest/base/Plugin.php - About 5 hrs to fix

          Function generateRules has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
          Open

              public function generateRules($table)
              {
                  $types = [];
                  $lengths = [];
                  foreach ($table->columns as $column) {
          Severity: Minor
          Found in src/base/BaseCrudController.php - About 5 hrs 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 link has 119 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  link: function(scope, element, attrs) {
                      // In standard-compliant browsers we use a custom mime type and also encode the dnd-type in it.
                      // However, IE and Edge only support a limited number of mime types. The workarounds are described
                      // in https://github.com/marceljuenemann/angular-drag-and-drop-lists/wiki/Data-Transfer-Design
                      var MIME_TYPE = 'application/x-dnd';
          Severity: Major
          Found in src/resources/js/dnd.js - About 4 hrs to fix

            File Config.php has 363 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            <?php
            
            namespace luya\admin\ngrest;
            
            use luya\admin\Module;
            Severity: Minor
            Found in src/ngrest/Config.php - About 4 hrs to fix

              Function link has 114 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                      link: function (scope, element, attr) {
                          var defaultPosition = 'right';
              
                          var lastValue = null;
              
              
              Severity: Major
              Found in src/resources/js/directives.js - About 4 hrs to fix

                File User.php has 352 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                
                namespace luya\admin\models;
                
                use luya\admin\aws\ApiRequestInsightActiveWindow;
                Severity: Minor
                Found in src/models/User.php - About 4 hrs to fix

                  Function ngRestConfigDefine has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function ngRestConfigDefine(ConfigBuilder $config, $assignedType, array $fields)
                      {
                          $types = $this->ngRestAttributeTypes();
                          $extraTypes = $this->ngRestExtraAttributeTypes();
                  
                  
                  Severity: Minor
                  Found in src/ngrest/base/NgRestModel.php - About 4 hrs 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 getOperation has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
                  Open

                      protected function getOperation(UrlRule $urlRule, $verbName)
                      {
                          if (empty($urlRule->verb)) {
                              return false;
                          }
                  Severity: Minor
                  Found in src/openapi/UrlRuleRouteParser.php - About 4 hrs 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

                  File StorageController.php has 342 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  <?php
                  
                  namespace luya\admin\apis;
                  
                  use InvalidArgumentException;
                  Severity: Minor
                  Found in src/apis/StorageController.php - About 4 hrs to fix

                    File BaseSpecs.php has 337 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    namespace luya\admin\openapi\specs;
                    
                    use cebe\openapi\spec\Example;
                    Severity: Minor
                    Found in src/openapi/specs/BaseSpecs.php - About 4 hrs to fix

                      Method getOperation has 96 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function getOperation(UrlRule $urlRule, $verbName)
                          {
                              if (empty($urlRule->verb)) {
                                  return false;
                              }
                      Severity: Major
                      Found in src/openapi/UrlRuleRouteParser.php - About 3 hrs to fix

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

                            public function actionIndex($query)
                            {
                                $search = [];
                                $module = Yii::$app->getModule('admin');
                        
                        
                        Severity: Minor
                        Found in src/apis/SearchController.php - About 3 hrs 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 controller has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                controller: ['$scope', '$http', '$timeout', 'AdminToastService', function($scope, $http, $timeout, AdminToastService) {
                        
                                    // toggle window
                        
                                    $scope.getFirstAttributeKeyAsDefaultValue = function() {
                        Severity: Major
                        Found in src/resources/js/scheduler.js - About 3 hrs to fix

                          Method getParameters has 88 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              public function getParameters(): array
                              {
                                  $params = [];
                                  if ($this->getReflection() instanceof ReflectionMethod) {
                                      foreach ($this->getReflection()->getParameters() as $arg) {
                          Severity: Major
                          Found in src/openapi/specs/BaseSpecs.php - About 3 hrs to fix

                            ActiveWindow has 29 functions (exceeds 20 allowed). Consider refactoring.
                            Open

                            abstract class ActiveWindow extends BaseActiveResponse implements ViewContextInterface, ActiveWindowInterface, NgRestButtonConditionInterface, NgRestPermissionLevelInterface
                            {
                                /**
                                 * @var string $suffix The suffix to use for all classes
                                 */
                            Severity: Minor
                            Found in src/ngrest/base/ActiveWindow.php - About 3 hrs to fix

                              Angular has 29 functions (exceeds 20 allowed). Consider refactoring.
                              Open

                              class Angular
                              {
                                  /**
                                   * Type Cast values.
                                   *
                              Severity: Minor
                              Found in src/helpers/Angular.php - About 3 hrs to fix

                                Item has 29 functions (exceeds 20 allowed). Consider refactoring.
                                Open

                                class Item extends ItemAbstract implements LinkInterface
                                {
                                    use LinkTrait;
                                
                                    /**
                                Severity: Minor
                                Found in src/file/Item.php - About 3 hrs to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language