poisl/pc_event_scheduler

View on GitHub

Showing 9 of 22 total issues

Method notifyCommand has 41 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    public function notifyCommand()
    {
        $this->settings = $this->configurationManager->getConfiguration(
            ConfigurationManager::CONFIGURATION_TYPE_SETTINGS
        );
Severity: Minor
Found in Classes/Command/NotifyCommandController.php - About 1 hr to fix

    Method cancelAction has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        public function cancelAction()
        {
            if (!$this->div->isLoggedUserInGroup($this->settings['participantGroupId'])) {
                $this->addFlashMessage($this->div->translate('message.noParticipant', $this->extensionName), '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
                $this->redirect('list');
    Severity: Minor
    Found in Classes/Controller/EventController.php - About 1 hr to fix

      Method acceptAction has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          public function acceptAction()
          {
              if (!$this->div->isLoggedUserInGroup($this->settings['participantGroupId'])) {
                  $this->addFlashMessage($this->div->translate('message.noParticipant', $this->extensionName), '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
                  $this->redirect('list');
      Severity: Minor
      Found in Classes/Controller/EventController.php - About 1 hr to fix

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

            public function listAction()
            {
                if (!$this->div->isLoggedUserInGroup($this->settings['participantGroupId'])) {
                    $this->addFlashMessage($this->div->translate('message.noParticipant', $this->extensionName), '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
                    $this->redirect('list');
        Severity: Minor
        Found in Classes/Controller/StatisticsController.php - About 1 hr to fix

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

              public function calculateAverageAcceptsPerEventByYear($year, $accept){
                     $currentYear = date("Y");
                  
                  $lastDayInYear = new \DateTime();
                  $lastDayInYear -> setDate($year, 12, 31);
          Severity: Minor
          Found in Classes/Domain/Repository/EventRepository.php - About 1 hr to fix

            Function cancelAction has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function cancelAction()
                {
                    if (!$this->div->isLoggedUserInGroup($this->settings['participantGroupId'])) {
                        $this->addFlashMessage($this->div->translate('message.noParticipant', $this->extensionName), '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
                        $this->redirect('list');
            Severity: Minor
            Found in Classes/Controller/EventController.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 acceptAction has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                public function acceptAction()
                {
                    if (!$this->div->isLoggedUserInGroup($this->settings['participantGroupId'])) {
                        $this->addFlashMessage($this->div->translate('message.noParticipant', $this->extensionName), '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
                        $this->redirect('list');
            Severity: Minor
            Found in Classes/Controller/EventController.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 topParticipantsByYear has 26 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                public function topParticipantsByYear($year){
                    $currentYear = date("Y");
                    
                    $lastDayInYear = new \DateTime();
                    $lastDayInYear -> setDate($year, 12, 31);
            Severity: Minor
            Found in Classes/Domain/Repository/EventRepository.php - About 1 hr to fix

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

                  public function notifyCommand()
                  {
                      $this->settings = $this->configurationManager->getConfiguration(
                          ConfigurationManager::CONFIGURATION_TYPE_SETTINGS
                      );
              Severity: Minor
              Found in Classes/Command/NotifyCommandController.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

              Severity
              Category
              Status
              Source
              Language