RebelCode/rcmod-wp-bookings-cqrs

View on GitHub

Showing 19 of 63 total issues

Method setup has 401 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function setup()
    {
        return $this->_setupContainer(
            $this->_loadPhpConfigFile(RC_WP_BOOKINGS_CQRS_MODULE_CONFIG_FILE),
            [
Severity: Major
Found in src/Module/WpBookingsCqrsModule.php - About 2 days to fix

    File WpBookingsCqrsModule.php has 456 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace RebelCode\Storage\Resource\WordPress\Module;
    
    use Dhii\Config\ConfigFactoryInterface;
    Severity: Minor
    Found in src/Module/WpBookingsCqrsModule.php - About 6 hrs to fix

      File ResourcesEntityManager.php has 311 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace RebelCode\Storage\Resource\WordPress;
      
      use ArrayAccess;
      Severity: Minor
      Found in src/ResourcesEntityManager.php - About 3 hrs to fix

        ResourcesEntityManager has 23 functions (exceeds 20 allowed). Consider refactoring.
        Open

        class ResourcesEntityManager extends BaseCqrsEntityManager
        {
            /* @since [*next-version*] */
            use ContainerGetPathCapableTrait;
        
        
        Severity: Minor
        Found in src/ResourcesEntityManager.php - About 2 hrs to fix

          Method _updateSessionRules has 42 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              protected function _updateSessionRules($id, $data)
              {
                  $b = $this->exprBuilder;
          
                  try {
          Severity: Minor
          Found in src/ResourcesEntityManager.php - About 1 hr to fix

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

                    SelectCapableInterface $selectRm,
                    InsertCapableInterface $insertRm,
                    UpdateCapableInterface $updateRm,
                    DeleteCapableInterface $deleteRm,
                    SelectCapableInterface $rulesSelectRm,
            Severity: Major
            Found in src/ResourcesEntityManager.php - About 1 hr to fix

              Method _processSessionRuleData has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function _processSessionRuleData($resourceId, $ruleData, $serviceTz)
                  {
                      $allDay = $this->_containerGet($ruleData, 'isAllDay');
              
                      // Parse the service timezone name into a timezone object
              Severity: Minor
              Found in src/ResourcesEntityManager.php - About 1 hr to fix

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

                        wpdb $wpdb,
                        TemplateInterface $expressionTemplate,
                        MapFactoryInterface $factory,
                        $tables,
                        $fieldColumnMap,
                Severity: Major
                Found in src/Wpdb/BookingsSelectResourceModel.php - About 1 hr to fix

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

                          wpdb $wpdb,
                          TemplateInterface $template,
                          MapFactoryInterface $mapFactory,
                          $tables,
                          $fieldColumnMap,
                  Severity: Major
                  Found in src/Wpdb/UnbookedSessionsWpdbSelectResourceModel.php - About 1 hr to fix

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

                            SelectCapableInterface $selectRm,
                            InsertCapableInterface $insertRm,
                            UpdateCapableInterface $updateRm,
                            DeleteCapableInterface $deleteRm,
                            InsertCapableInterface $bkResourcesInsertRm,
                    Severity: Major
                    Found in src/BookingsEntityManager.php - About 1 hr to fix

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

                              wpdb $wpdb,
                              TemplateInterface $expressionTemplate,
                              MapFactoryInterface $factory,
                              $tables,
                              $fieldColumnMap,
                      Severity: Major
                      Found in src/Wpdb/EddBkWpdbSelectResourceModel.php - About 1 hr to fix

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

                                wpdb $wpdb,
                                TemplateInterface $expressionTemplate,
                                MapFactoryInterface $mapFactory,
                                $tables,
                                $fieldColumnMap,
                        Severity: Major
                        Found in src/Wpdb/BookingStatusWpdbSelectResourceModel.php - About 50 mins to fix

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

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

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

                                    SelectCapableInterface $selectRm,
                                    InsertCapableInterface $insertRm,
                                    UpdateCapableInterface $updateRm,
                                    DeleteCapableInterface $deleteRm,
                                    FactoryInterface $orderFactory,
                            Severity: Minor
                            Found in src/BaseCqrsEntityManager.php - About 45 mins to fix

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

                                  public function __construct(Migrator $migrator, $targetVersion, $currentVersion, $eventManager, $eventFactory)
                              Severity: Minor
                              Found in src/Module/AutoMigrationsHandler.php - About 35 mins to fix

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

                                    public function query($query = [], $limit = null, $offset = null, $orderBy = null, $desc = false)
                                Severity: Minor
                                Found in src/BaseCqrsEntityManager.php - About 35 mins to fix

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

                                          $mysqli,
                                          $migrationsDir,
                                          $dbVersion,
                                          TemplateFactoryInterface $templateFactory,
                                          $placeholderValues
                                  Severity: Minor
                                  Found in src/Module/Migrator.php - About 35 mins to fix

                                    Function _updateSessionRules has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        protected function _updateSessionRules($id, $data)
                                        {
                                            $b = $this->exprBuilder;
                                    
                                            try {
                                    Severity: Minor
                                    Found in src/ResourcesEntityManager.php - About 35 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 _normalizeSqlFieldColumnMap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                                    Open

                                        protected function _normalizeSqlFieldColumnMap($map)
                                        {
                                            $newMap     = [];
                                            $expBuilder = $this->_getExprBuilder();
                                    
                                    
                                    Severity: Minor
                                    Found in src/Wpdb/NormalizeSqlFieldColumnMapCapableTrait.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