luyadev/luya-module-admin

View on GitHub

Showing 503 of 503 total issues

File admin.php has 507 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

return [
    'language_name' => 'Türkçe',
    'button_save' => 'Kaydet',
Severity: Major
Found in src/messages/tr/admin.php - About 1 day to fix

    File admin.php has 507 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    return [
        'language_name' => 'Bahasa',
        'button_save' => 'Simpan',
    Severity: Major
    Found in src/messages/id/admin.php - About 1 day to fix

      File admin.php has 506 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      return [
          'language_name' => 'Español',
          'button_save' => 'Guardar',
      Severity: Major
      Found in src/messages/es/admin.php - About 1 day to fix

        File Api.php has 505 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        <?php
        
        namespace luya\admin\ngrest\base;
        
        use luya\admin\base\RestActiveController;
        Severity: Major
        Found in src/ngrest/base/Api.php - About 1 day to fix

          File _angulardirectives.php has 499 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          <?php
          use luya\admin\Module as Admin;
          
          ?>
          <div class="loading-overlay" ng-if="LuyaLoading.getState()">
          Severity: Minor
          Found in src/views/layouts/_angulardirectives.php - About 1 day to fix

            Function getModules has a Cognitive Complexity of 50 (exceeds 5 allowed). Consider refactoring.
            Open

                public function getModules()
                {
                    if ($this->_modules !== null) {
                        return $this->_modules;
                    }
            Severity: Minor
            Found in src/components/AdminMenu.php - About 7 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

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

            zaa.factory("ServiceFoldersData", ['$http', '$q', '$rootScope', function($http, $q, $rootScope) {
                
                var service = [];
                
                service.data = null;
            Severity: Major
            Found in src/resources/js/services.js and 2 other locations - About 7 hrs to fix
            src/resources/js/services.js on lines 335..355
            src/resources/js/services.js on lines 405..425

            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 187.

            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 3 locations. Consider refactoring.
            Open

            zaa.factory("ServiceFiltersData", ['$http', '$q', '$rootScope', function($http, $q, $rootScope) {
                var service = [];
                
                service.data = null;
                
            Severity: Major
            Found in src/resources/js/services.js and 2 other locations - About 7 hrs to fix
            src/resources/js/services.js on lines 136..157
            src/resources/js/services.js on lines 405..425

            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 187.

            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 3 locations. Consider refactoring.
            Open

            zaa.factory("ServicePropertiesData", ['$http', '$q', '$rootScope', function($http, $q, $rootScope) {
                var service = [];
                
                service.data = null;
                
            Severity: Major
            Found in src/resources/js/services.js and 2 other locations - About 7 hrs to fix
            src/resources/js/services.js on lines 136..157
            src/resources/js/services.js on lines 335..355

            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 187.

            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

            NgRestModel has 51 functions (exceeds 20 allowed). Consider refactoring.
            Open

            abstract class NgRestModel extends ActiveRecord implements GenericSearchInterface, NgRestModelInterface
            {
                /**
                 * @var string This event will be trigger after the find population of each row when ngrest loads the data from the server to edit data. (When click on edit icon)
                 */
            Severity: Major
            Found in src/ngrest/base/NgRestModel.php - About 7 hrs to fix

              File NgRestModel.php has 454 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              <?php
              
              namespace luya\admin\ngrest\base;
              
              use luya\admin\base\GenericSearchInterface;
              Severity: Minor
              Found in src/ngrest/base/NgRestModel.php - About 6 hrs to fix

                File main.php has 446 lines of code (exceeds 250 allowed). Consider refactoring.
                Open

                <?php
                use luya\admin\Module as Admin;
                use luya\helpers\Url;
                
                $user = Yii::$app->adminuser->getIdentity();
                Severity: Minor
                Found in src/views/layouts/main.php - About 6 hrs to fix

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

                      $('#abortTwoFa').click(function (e) {
                          $('.spinner').hide();
                          $('.submit-icon').show();
                          $('#errorsContainer').hide();
                          $('#twofaForm').hide();
                  Severity: Major
                  Found in src/resources/js/login.js and 1 other location - About 6 hrs to fix
                  src/resources/js/login.js on lines 128..140

                  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 165.

                  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

                      $('#abortToken').click(function (e) {
                          $('.spinner').hide();
                          $('.submit-icon').show();
                          $('#errorsContainer').hide();
                          $('#secureForm').hide();
                  Severity: Major
                  Found in src/resources/js/login.js and 1 other location - About 6 hrs to fix
                  src/resources/js/login.js on lines 143..155

                  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 165.

                  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 getModuleItems has a Cognitive Complexity of 42 (exceeds 5 allowed). Consider refactoring.
                  Open

                      public function getModuleItems($nodeId)
                      {
                          if (isset($this->_nodeItems[$nodeId])) {
                              return $this->_nodeItems[$nodeId];
                          }
                  Severity: Minor
                  Found in src/components/AdminMenu.php - About 6 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

                  Config has 45 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class Config extends BaseObject implements ConfigInterface
                  {
                      private $_model;
                  
                      /**
                  Severity: Minor
                  Found in src/ngrest/Config.php - About 6 hrs to fix

                    File BaseFileSystemStorage.php has 421 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    <?php
                    
                    namespace luya\admin\storage;
                    
                    use luya\admin\events\FileEvent;
                    Severity: Minor
                    Found in src/storage/BaseFileSystemStorage.php - About 6 hrs to fix

                      File RenderCrud.php has 419 lines of code (exceeds 250 allowed). Consider refactoring.
                      Open

                      <?php
                      
                      namespace luya\admin\ngrest\render;
                      
                      use luya\admin\components\Auth;
                      Severity: Minor
                      Found in src/ngrest/render/RenderCrud.php - About 6 hrs to fix

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

                                  , resetToMaxDate = function resetToMaxDate() {
                        
                                    $scope.month = $filter('date')(new Date($scope.dateMaxLimit), 'MMMM');
                                    $scope.monthNumber = Number($filter('date')(new Date($scope.dateMaxLimit), 'MM'));
                                    $scope.day = Number($filter('date')(new Date($scope.dateMaxLimit), 'dd'));
                        src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 256..264

                        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 152.

                        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

                                  , resetToMinDate = function resetToMinDate() {
                        
                                    $scope.month = $filter('date')(new Date($scope.dateMinLimit), 'MMMM');
                                    $scope.monthNumber = Number($filter('date')(new Date($scope.dateMinLimit), 'MM'));
                                    $scope.day = Number($filter('date')(new Date($scope.dateMinLimit), 'dd'));
                        src/resources/vendorlibs/angularjs-datepicker/angular-datepicker.js on lines 265..273

                        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 152.

                        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

                        Severity
                        Category
                        Status
                        Source
                        Language