mustardandrew/muan-laravel-admin

View on GitHub

Showing 23 of 52 total issues

Method getColumns has 74 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    protected function getColumns() : array
    {
        return [
            'id' => [
                'title' => 'ID',
Severity: Major
Found in app/Http/Controllers/Admin/PostController.php - About 2 hrs to fix

    Method getColumns has 63 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function getColumns() : array
        {
            return [
                'id' => [
                    'title' => 'ID',
    Severity: Major
    Found in app/Http/Controllers/Admin/CategoryController.php - About 2 hrs to fix

      Method getColumns has 60 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function getColumns() : array
          {
              return [
                  'id' => [
                      'title' => 'ID',
      Severity: Major
      Found in app/Http/Controllers/Admin/PageController.php - About 2 hrs to fix

        Method getColumns has 60 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function getColumns() : array
            {
                return [
                    'id' => [
                        'title' => 'ID',
        Severity: Major
        Found in app/Http/Controllers/Admin/BlockController.php - About 2 hrs to fix

          Method getColumns has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function getColumns(): array
              {
                  return [
                      'id' => [
                          'title'  => 'ID',
          Severity: Major
          Found in app/Http/Controllers/Admin/UserController.php - About 2 hrs to fix

            mutations has 21 functions (exceeds 20 allowed). Consider refactoring.
            Open

            const mutations = {
                // Set config
                [header.SETTINGS_SET_CONFIG_MUTATION] (state, config) {
                    state.config = config;
                },
            Severity: Minor
            Found in resources/assets/js/admin/store/modules/settings/mutations.js - About 2 hrs to fix

              Function header.SETTINGS_FORM_PROPERTY_SEND_ACTION has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
              Open

                  async [header.SETTINGS_FORM_PROPERTY_SEND_ACTION] ({commit, state}) {
                      try {
                          commit(header.SETTINGS_PROPERTY_FORM_CLEAR_ERRORS_MUTATION);
              
                          let url = state.config.addPropertyRoute;
              Severity: Minor
              Found in resources/assets/js/admin/store/modules/settings/actions.js - About 2 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

              Method getColumns has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function getColumns() : array
                  {
                      return [
                          'id' => [
                              'title' => 'ID',
              Severity: Major
              Found in app/Http/Controllers/Admin/CommentController.php - About 2 hrs to fix

                Method getColumns has 47 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    protected function getColumns() : array
                    {
                        return [
                            'id' => [
                                'title' => 'ID',
                Severity: Minor
                Found in app/Http/Controllers/Admin/TagController.php - About 1 hr to fix

                  Function initTab has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  window.initTab = function(tabsOne) {
                      let items = tabsOne.querySelectorAll('.tabs__items .item');
                      if (! items.length) {
                          return;
                      }
                  Severity: Minor
                  Found in resources/assets/js/admin/layout.js - About 1 hr to fix

                    Function header.SETTINGS_EDIT_FORM_GROUP_ACTION has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        async [header.SETTINGS_EDIT_FORM_GROUP_ACTION] ({commit, dispatch, state}) {
                            try {
                                commit(header.SETTINGS_GROUP_FORM_CLEAR_ERRORS_MUTATION);
                    
                                let url = state.config.editGroupRoute;
                    Severity: Minor
                    Found in resources/assets/js/admin/store/modules/settings/actions.js - 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 header.SETTINGS_FORM_GROUP_SEND_ACTION has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
                    Open

                        async [header.SETTINGS_FORM_GROUP_SEND_ACTION] ({commit, state}) {
                            try {
                                commit(header.SETTINGS_GROUP_FORM_CLEAR_ERRORS_MUTATION);
                    
                                let formData = state.groupFormData;
                    Severity: Minor
                    Found in resources/assets/js/admin/store/modules/settings/actions.js - 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

                    Method getColumns has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        protected function getColumns() : array
                        {
                            return [
                                'id' => [
                                    'title' => 'ID',
                    Severity: Minor
                    Found in app/Http/Controllers/Admin/RoleController.php - About 1 hr to fix

                      Method getColumns has 38 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          protected function getColumns(): array
                          {
                              return [
                                  'id' => [
                                      'title' => 'ID',
                      Severity: Minor
                      Found in app/Http/Controllers/Admin/PermissionController.php - About 1 hr to fix

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

                            protected function getActions(): array
                            {
                                return [
                                    'create' => [
                                        'title' => 'Create',
                        Severity: Minor
                        Found in app/Http/Controllers/Admin/UserController.php - About 1 hr to fix

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

                              public function import(array $data)
                              {
                                  foreach ($data as &$groupItem) {
                                      $groupItem = (array) $groupItem;
                          
                          
                          Severity: Minor
                          Found in app/Services/ExportImportSettingsService.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 initTab has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                          window.initTab = function(tabsOne) {
                              let items = tabsOne.querySelectorAll('.tabs__items .item');
                              if (! items.length) {
                                  return;
                              }
                          Severity: Minor
                          Found in resources/assets/js/admin/layout.js - 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 searchPaginateAndOrder has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                              protected function searchPaginateAndOrder()
                              {
                                  $request = request();
                                  $request->validate([
                                      'column'    => 'alpha_dash|in:' . implode(',', $this->getColumnsKey()),
                          Severity: Minor
                          Found in app/Http/DataTable/ExtendDataTableController.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 header.DATA_TABLE_GET_LIST_ACTION has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              async [header.DATA_TABLE_GET_LIST_ACTION] ({commit, state}) {
                                  try {
                                      commit(header.DATA_TABE_START_LOADING_MUTATION);
                          
                                      let url = `${state.config.route}`;
                          Severity: Minor
                          Found in resources/assets/js/admin/store/modules/data-table/actions.js - About 1 hr to fix

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

                                protected function getActions(): array
                                {
                                    return [
                                        'create' => [
                                            'title' => 'Create',
                            Severity: Minor
                            Found in app/Http/Controllers/Admin/PermissionController.php - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language