RebelCode/rcmod-eddbk-rest-api

View on GitHub

Showing 87 of 87 total issues

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

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

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

    <?php
    
    namespace RebelCode\EddBookings\RestApi\Handlers\Resources;
    
    use ArrayAccess;
    Severity: Major
    Found in src/Handlers/Resources/CreateResourceHandler.php and 3 other locations - About 1 day to fix
    src/Handlers/Bookings/CreateBookingHandler.php on lines 1..135
    src/Handlers/Clients/CreateClientHandler.php on lines 1..133
    src/Handlers/Services/CreateServiceHandler.php on lines 1..135

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

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

    <?php
    
    namespace RebelCode\EddBookings\RestApi\Handlers\Services;
    
    use ArrayAccess;
    Severity: Major
    Found in src/Handlers/Services/CreateServiceHandler.php and 3 other locations - About 1 day to fix
    src/Handlers/Bookings/CreateBookingHandler.php on lines 1..135
    src/Handlers/Clients/CreateClientHandler.php on lines 1..133
    src/Handlers/Resources/CreateResourceHandler.php on lines 1..135

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

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

    <?php
    
    namespace RebelCode\EddBookings\RestApi\Handlers\Clients;
    
    use ArrayAccess;
    Severity: Major
    Found in src/Handlers/Clients/CreateClientHandler.php and 3 other locations - About 1 day to fix
    src/Handlers/Bookings/CreateBookingHandler.php on lines 1..135
    src/Handlers/Resources/CreateResourceHandler.php on lines 1..135
    src/Handlers/Services/CreateServiceHandler.php on lines 1..135

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

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

    <?php
    
    namespace RebelCode\EddBookings\RestApi\Handlers\Bookings;
    
    use ArrayAccess;
    Severity: Major
    Found in src/Handlers/Bookings/CreateBookingHandler.php and 3 other locations - About 1 day to fix
    src/Handlers/Clients/CreateClientHandler.php on lines 1..133
    src/Handlers/Resources/CreateResourceHandler.php on lines 1..135
    src/Handlers/Services/CreateServiceHandler.php on lines 1..135

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

    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

    File EddBkRestApiModule.php has 500 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    <?php
    
    namespace RebelCode\EddBookings\RestApi\Module;
    
    use ArrayIterator;
    Severity: Minor
    Found in src/Module/EddBkRestApiModule.php - About 1 day to fix

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

          protected function _buildDeleteCondition($params)
          {
              // The query condition
              $condition = null;
      
      
      Severity: Major
      Found in src/Controller/AbstractBaseCqrsController.php and 1 other location - About 7 hrs to fix
      src/Controller/AbstractBaseCqrsController.php on lines 436..459

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

      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

          protected function _buildUpdateCondition($params)
          {
              // The query condition
              $condition = null;
      
      
      Severity: Major
      Found in src/Controller/AbstractBaseCqrsController.php and 1 other location - About 7 hrs to fix
      src/Controller/AbstractBaseCqrsController.php on lines 470..493

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

      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

      <?php
      
      namespace RebelCode\EddBookings\RestApi\Handlers\Bookings;
      
      use Dhii\Data\Container\CreateNotFoundExceptionCapableTrait;
      Severity: Major
      Found in src/Handlers/Bookings/BookingInfoHandler.php and 1 other location - About 7 hrs to fix
      src/Handlers/Resources/ResourceInfoHandler.php on lines 1..76

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

      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

      <?php
      
      namespace RebelCode\EddBookings\RestApi\Handlers\Resources;
      
      use Dhii\Data\Container\CreateNotFoundExceptionCapableTrait;
      Severity: Major
      Found in src/Handlers/Resources/ResourceInfoHandler.php and 1 other location - About 7 hrs to fix
      src/Handlers/Bookings/BookingInfoHandler.php on lines 1..76

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

      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

      File BookingsController.php has 381 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      <?php
      
      namespace RebelCode\EddBookings\RestApi\Controller;
      
      use Dhii\Data\Container\ContainerSetCapableTrait;
      Severity: Minor
      Found in src/Controller/BookingsController.php - About 5 hrs to fix

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

        <?php
        
        /**
         * This file contains the configuration for the routes related to resources in the EDD Bookings.
         *
        Severity: Major
        Found in config/routes/resources.php and 1 other location - About 3 hrs to fix
        config/routes/bookings.php on lines 1..69

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

        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

        <?php
        
        /**
         * This file contains the configuration for the routes related to bookings in the EDD Bookings.
         *
        Severity: Major
        Found in config/routes/bookings.php and 1 other location - About 3 hrs to fix
        config/routes/resources.php on lines 1..69

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

        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

        The class AbstractBaseCqrsController has an overall complexity of 71 which is very high. The configured complexity threshold is 50.
        Open

        abstract class AbstractBaseCqrsController extends AbstractBaseController implements ControllerInterface
        {
            /* @since [*next-version*] */
            use ContainerGetCapableTrait;
        
        

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

            protected function _paramsToResourceData($params = [])
            {
                $mapping = $this->_getResourceDataParamMapping();
                $data    = [];
        
        
        Severity: Major
        Found in src/Controller/ResourcesController.php and 1 other location - About 3 hrs to fix
        src/Controller/ServicesController.php on lines 311..336

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

        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

            protected function _paramsToServiceData($params = [])
            {
                $mapping = $this->_getServiceDataParamMapping();
                $data = [];
        
        
        Severity: Major
        Found in src/Controller/ServicesController.php and 1 other location - About 3 hrs to fix
        src/Controller/ResourcesController.php on lines 244..269

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

        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

        Method _getUpdateParamFieldMapping has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            protected function _getUpdateParamFieldMapping()
            {
                return [
                    'start'    => [
                        'field'     => 'start',
        Severity: Major
        Found in src/Controller/BookingsController.php - About 2 hrs to fix

          AbstractBaseCqrsController has 24 functions (exceeds 20 allowed). Consider refactoring.
          Open

          abstract class AbstractBaseCqrsController extends AbstractBaseController implements ControllerInterface
          {
              /* @since [*next-version*] */
              use ContainerGetCapableTrait;
          
          
          Severity: Minor
          Found in src/Controller/AbstractBaseCqrsController.php - About 2 hrs to fix

            Method _getAvailabilityRuleMapConfig has 58 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                protected function _getAvailabilityRuleMapConfig()
                {
                    return [
                        [
                            MapTransformer::K_SOURCE => 'id',
            Severity: Major
            Found in src/Transformer/AvailabilityRuleTransformer.php - About 2 hrs to fix

              Method _getServiceDataParamMapping has 56 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  protected function _getServiceDataParamMapping()
                  {
                      return [
                          'id' => [
                              'field' => 'id',
              Severity: Major
              Found in src/Controller/ServicesController.php - About 2 hrs to fix
                Severity
                Category
                Status
                Source
                Language