RebelCode/rcmod-eddbk-session-generator

View on GitHub

Showing 12 of 32 total issues

Method make has 107 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function make($config = null)
    {
        $start       = (int) $this->_containerGet($config, 'start');
        $end         = (int) $this->_containerGet($config, 'end');
        $resourceIds = $this->_containerGet($config, 'resource_ids');
Severity: Major
Found in src/Module/AvailabilityFactory.php - About 4 hrs to fix

    Function _generateForService has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring.
    Open

        protected function _generateForService($service)
        {
            // Get the service's schedule availability, since service availability it saved in its schedule
            $scheduleId = $this->_containerGet($service, 'schedule_id');
            $schedule   = $this->resourcesManager->get($scheduleId);
    Severity: Minor
    Found in src/Module/GenerateSessionsHandler.php - About 3 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 _generateForService has 69 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        protected function _generateForService($service)
        {
            // Get the service's schedule availability, since service availability it saved in its schedule
            $scheduleId = $this->_containerGet($service, 'schedule_id');
            $schedule   = $this->resourcesManager->get($scheduleId);
    Severity: Major
    Found in src/Module/GenerateSessionsHandler.php - About 2 hrs to fix

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

          public function make($config = null)
          {
              $start       = (int) $this->_containerGet($config, 'start');
              $end         = (int) $this->_containerGet($config, 'end');
              $resourceIds = $this->_containerGet($config, 'resource_ids');
      Severity: Minor
      Found in src/Module/AvailabilityFactory.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

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

              SessionGeneratorInterface $generator,
              EntityManagerInterface $servicesManager,
              GetCapableManagerInterface $resourcesManager,
              FactoryInterface $sessionTypeFactory,
              FactoryInterface $availabilityFactory,
      Severity: Major
      Found in src/Module/GenerateSessionsHandler.php - About 1 hr to fix

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

                $periodFactory,
                $start,
                $end,
                $repeatFreq = null,
                $repeatEnd = null,
        Severity: Major
        Found in src/Generator/MonthlyRepeatingRule.php - About 50 mins to fix

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

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

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

                    $periodFactory,
                    $start,
                    $end,
                    $repeatFreq = null,
                    $repeatEnd = null,
            Severity: Minor
            Found in src/Generator/WeeklyRepeatingRule.php - About 45 mins to fix

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

                      $periodFactory,
                      $start,
                      $end,
                      $repeatFreq = null,
                      $repeatEnd = null,
              Severity: Minor
              Found in src/Generator/YearlyRepeatingRule.php - About 45 mins to fix

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

                        $periodFactory,
                        $start,
                        $end,
                        $repeatFreq = null,
                        $repeatEnd = null,
                Severity: Minor
                Found in src/Generator/AbstractIteratorRule.php - About 45 mins to fix

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

                          $periodFactory,
                          $start,
                          $end,
                          $repeatFreq = null,
                          $repeatEnd = null,
                  Severity: Minor
                  Found in src/Generator/DailyRepeatingRule.php - About 45 mins to fix

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

                        protected function _getServicesForResource($resourceId)
                        {
                            $results  = [];
                            $services = $this->servicesManager->query();
                    
                    
                    Severity: Minor
                    Found in src/Module/GenerateSessionsHandler.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