luyadev/luya-module-admin

View on GitHub

Showing 331 of 503 total issues

Function controller has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        controller: ['$scope', '$element', '$timeout', function ($scope, $element, $timeout) {

            if ($scope.model === undefined) {
                $scope.model = [];
            }
Severity: Minor
Found in src/resources/js/formdirectives.js - About 1 hr to fix

    Method ngRestActiveWindows has 27 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function ngRestActiveWindows()
        {
            return [
                [
                    'class' => DetailViewActiveWindow::class,
    Severity: Minor
    Found in src/models/NgrestLog.php - About 1 hr to fix

      Method extractFilesDataFromFilesArray has 27 lines of code (exceeds 25 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

        Method callbackPie has 27 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            public function callbackPie()
            {
                return [
                'tooltip' => ['trigger' => 'item', 'formatter' => '{c} {b}'],
                'legend' => ['orient' => 'vertical', 'x' => 'left', 'data' => [Module::t('aw_userhistorysummary_contribcount_inserts'), Module::t('aw_userhistorysummary_contribcount_updates')]],
        Severity: Minor
        Found in src/aws/UserHistorySummaryActiveWindow.php - About 1 hr to fix

          Function controller has 26 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                  controller: ['$scope', '$http', function ($scope, $http) {
                      $scope.tags = [];
          
                      $http.get('admin/api-admin-common/tags').then(function (response) {
                          angular.forEach(response.data, function (value) {
          Severity: Minor
          Found in src/resources/js/formdirectives.js - About 1 hr to fix

            Method startImages has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function startImages()
                {
                    $imageCount = 0;
                    // sync images
                    foreach ((new \luya\admin\image\Query())->all() as $image) {
            Severity: Minor
            Found in src/proxy/ClientTransfer.php - About 1 hr to fix

              Method actionCleanup has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  public function actionCleanup()
                  {
                      $tagIds = Tag::find()->select(['id'])->column();
              
                      $batch = TagRelation::find()->batch();
              Severity: Minor
              Found in src/commands/TagController.php - About 1 hr to fix

                Method createSchema has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    public function createSchema($attributeName)
                    {
                        $property = $this->phpDocParser->getProperty($attributeName);
                
                        $type = $property->getType();
                Severity: Minor
                Found in src/openapi/specs/ActiveRecordToSchema.php - About 1 hr to fix

                  Consider simplifying this complex logical expression.
                  Open

                                    if (date.getFullYear() &&
                                     !isNaN(date.getDay()) &&
                                     !isNaN(date.getMonth()) &&
                                     $scope.isSelectableDay(date.getMonth(), date.getFullYear(), date.getDay()) &&
                                     $scope.isSelectableDate(date.getMonth(), date.getFullYear(), date.getDay()) &&
                  Severity: Major
                  Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 1 hr to fix

                    Function actionServices has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function actionServices()
                        {
                            $settings = [];
                            $apiEndpoint = $this->model->ngRestApiEndpoint();
                            $userSortSettings = Yii::$app->adminuser->identity->setting->get('ngrestorder.admin/'.$apiEndpoint, false);
                    Severity: Minor
                    Found in src/ngrest/base/Api.php - About 55 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 onListFind has a Cognitive Complexity of 9 (exceeds 5 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 55 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 optionsArrayInput has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public static function optionsArrayInput($data)
                        {
                            // seems to be a two way data binind, thefore direct return the string and do not transform.
                            if (is_scalar($data)) {
                                return $data;
                    Severity: Minor
                    Found in src/helpers/Angular.php - About 55 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 setBuildConfig has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function setBuildConfig(array $config)
                        {
                            $this->_buildConfig = $config;
                    
                            foreach ($config['tables'] as $tableName => $tableConfig) {
                    Severity: Minor
                    Found in src/proxy/ClientBuild.php - About 55 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 generateLabels has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
                    Open

                        public function generateLabels($table)
                        {
                            $labels = [];
                            foreach ($table->columns as $column) {
                                if ($this->generateLabelsFromComments && !empty($column->comment)) {
                    Severity: Minor
                    Found in src/base/BaseCrudController.php - About 55 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 controller has 7 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            controller: ['$scope', '$http', '$filter', 'ServiceFiltersData', 'ServiceImagesData', 'AdminToastService', 'ServiceFilesData', function ($scope, $http, $filter, ServiceFiltersData, ServiceImagesData, AdminToastService, ServiceFilesData) {
                    Severity: Major
                    Found in src/resources/js/directives.js - About 50 mins to fix

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

                          public function renderElementPlugins($configContext, $typeConfig, $uniqueId, $attribute, $ngRestModel, $label, $elmni18n)
                      Severity: Major
                      Found in src/ngrest/render/RenderCrud.php - About 50 mins to fix

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

                            public static function schedule($ngModel, $label, $primaryKeyValue, array $values, $modelClass, $attributeName, array $options = [])
                        Severity: Major
                        Found in src/helpers/Angular.php - About 50 mins to fix

                          Function datepickerDirective has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                              , datepickerDirective = function datepickerDirective($window, $compile, $locale, $filter, $interpolate, $timeout) {
                          Severity: Minor
                          Found in src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js - About 45 mins to fix

                            Function where has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function where(array $args)
                                {
                                    foreach ($args as $key => $value) {
                                        if (in_array($value, $this->_whereOperators, true)) {
                                            if (count($args) !== 3) {
                            Severity: Minor
                            Found in src/storage/QueryTrait.php - About 45 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 getConfigButtonCondition has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
                            Open

                                public function getConfigButtonCondition($scope)
                                {
                                    $buttonConditionConfigOption = $this->config->getOption('buttonCondition');
                            
                                    // return empty string of no condition is defined
                            Severity: Minor
                            Found in src/ngrest/render/RenderCrud.php - About 45 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