RebelCode/rcmod-wp-bookings-ui

View on GitHub

Showing 13 of 41 total issues

File config.php has 339 lines of code (exceeds 250 allowed). Consider refactoring.
Open

<?php

return [
    'wp_bookings_ui' => [
        'wp_rest_api_nonce' => 'wp_rest',
Severity: Minor
Found in config/config.php - About 4 hrs to fix

    File WpBookingsUiModule.php has 291 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace RebelCode\Bookings\WordPress\Module;
    
    use Dhii\Data\Container\ContainerFactoryInterface;
    Severity: Minor
    Found in src/WpBookingsUiModule.php - About 3 hrs to fix

      Method _adminMenu has 72 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          protected function _adminMenu($c)
          {
              $rootMenuConfig         = $c->get('wp_bookings_ui/menu/root');
              $servicesMenuConfig     = $c->get('wp_bookings_ui/menu/services');
              $staffMembersMenuConfig = $c->get('wp_bookings_ui/menu/staff_members');
      Severity: Major
      Found in src/WpBookingsUiModule.php - About 2 hrs to fix

        Method __construct has 11 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                $settingsContainer,
                $statuses,
                $statusesLabels,
                $currencyConfig,
                $formatsConfig,
        Severity: Major
        Found in src/Handlers/GeneralUiStateHandler.php - About 1 hr to fix

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

              protected function _enqueueAssets(ContainerInterface $assetsUrlMap, ContainerInterface $c)
              {
                  if (!$this->_isOnAppPage()) {
                      return;
                  }
          Severity: Minor
          Found in src/WpBookingsUiModule.php - About 1 hr to fix

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

                protected function _enqueueAssets(ContainerInterface $assetsUrlMap, ContainerInterface $c)
                {
                    if (!$this->_isOnAppPage()) {
                        return;
                    }
            Severity: Minor
            Found in src/WpBookingsUiModule.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

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

                    $key,
                    $dependencies,
                    $configFactory,
                    $containerFactory,
                    $compContainerFactory,
            Severity: Major
            Found in src/WpBookingsUiModule.php - About 50 mins to fix

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

                      $statuses,
                      $screenOptionsKey,
                      $screenOptionsFields,
                      $screenOptionsEndpoint,
                      $screenOptionsCache,
              Severity: Major
              Found in src/Handlers/BookingsStateStatusesHandler.php - About 50 mins to fix

                Method _getUiConfig has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                    protected function _getUiConfig($currencyConfig, $formatsConfig, $linksConfig, $uiActionsConfig, $validatorsConfig)
                Severity: Minor
                Found in src/Handlers/GeneralUiStateHandler.php - About 35 mins to fix

                  Method __construct has 5 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                      public function __construct($settingsContainer, $fieldsOptions, $fields, $updateEndpoint, $defaultWizardLabels)
                  Severity: Minor
                  Found in src/Handlers/SettingsStateHandler.php - About 35 mins to fix

                    Function _iteratorToArrayRecursive has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function _iteratorToArrayRecursive($iterator, $transformer = null)
                        {
                            $iterator = $this->_normalizeIterable($iterator);
                            $array    = [];
                            foreach ($iterator as $key => $value) {
                    Severity: Minor
                    Found in src/IteratorToArrayRecursiveCapableTrait.php - About 25 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 _prepareEndpoints has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function _prepareEndpoints($endpointsConfig)
                        {
                            $resultingConfig = [];
                    
                            foreach ($endpointsConfig as $namespace => $endpoints) {
                    Severity: Minor
                    Found in src/WpBookingsUiModule.php - About 25 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 _getWebsiteTimezone has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                        protected function _getWebsiteTimezone()
                        {
                            $currentOffset = get_option('gmt_offset');
                            $tzstring      = get_option('timezone_string');
                    
                    
                    Severity: Minor
                    Found in src/Handlers/GeneralUiStateHandler.php - About 25 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