poisl/pc_event_scheduler

View on GitHub

Showing 13 of 22 total issues

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

<?php
namespace PoiCom\PcEventScheduler\Tests\Unit\Controller;
/***************************************************************
 *  Copyright notice
 *
Severity: Major
Found in Tests/Unit/Controller/ParticipantControllerTest.php and 2 other locations - About 3 days to fix
Tests/Unit/Controller/EventControllerTest.php on lines 1..138
Tests/Unit/Controller/HolidayControllerTest.php on lines 1..138

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

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

<?php
namespace PoiCom\PcEventScheduler\Tests\Unit\Controller;
/***************************************************************
 *  Copyright notice
 *
Severity: Major
Found in Tests/Unit/Controller/HolidayControllerTest.php and 2 other locations - About 3 days to fix
Tests/Unit/Controller/EventControllerTest.php on lines 1..138
Tests/Unit/Controller/ParticipantControllerTest.php on lines 1..138

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

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

<?php
namespace PoiCom\PcEventScheduler\Tests\Unit\Controller;
/***************************************************************
 *  Copyright notice
 *
Severity: Major
Found in Tests/Unit/Controller/EventControllerTest.php and 2 other locations - About 3 days to fix
Tests/Unit/Controller/HolidayControllerTest.php on lines 1..138
Tests/Unit/Controller/ParticipantControllerTest.php on lines 1..138

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

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

    public function createAction(\PoiCom\PcEventScheduler\Domain\Model\Holiday $holiday)
    {
        if (!$this->div->isLoggedUserInGroup($this->settings['eventAdminGroupId'])) {
            $this->addFlashMessage($this->div->translate('message.noAdmin', $this->extensionName), '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
            $this->redirect('list');
Severity: Major
Found in Classes/Controller/HolidayController.php and 2 other locations - About 2 hrs to fix
Classes/Controller/HolidayController.php on lines 111..120
Classes/Controller/HolidayController.php on lines 128..137

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

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

    public function deleteAction(\PoiCom\PcEventScheduler\Domain\Model\Holiday $holiday)
    {
        if (!$this->div->isLoggedUserInGroup($this->settings['eventAdminGroupId'])) {
            $this->addFlashMessage($this->div->translate('message.noAdmin', $this->extensionName), '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
            $this->redirect('list');
Severity: Major
Found in Classes/Controller/HolidayController.php and 2 other locations - About 2 hrs to fix
Classes/Controller/HolidayController.php on lines 82..91
Classes/Controller/HolidayController.php on lines 111..120

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

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

    public function updateAction(\PoiCom\PcEventScheduler\Domain\Model\Holiday $holiday)
    {
        if (!$this->div->isLoggedUserInGroup($this->settings['eventAdminGroupId'])) {
            $this->addFlashMessage($this->div->translate('message.noAdmin', $this->extensionName), '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
            $this->redirect('list');
Severity: Major
Found in Classes/Controller/HolidayController.php and 2 other locations - About 2 hrs to fix
Classes/Controller/HolidayController.php on lines 82..91
Classes/Controller/HolidayController.php on lines 128..137

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

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

    public function addParticipantToObjectStorageHoldingParticipants()
    {
        $participant = new \PoiCom\PcEventScheduler\Domain\Model\Participant();
        $participantsObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('attach'), array(), '', FALSE);
        $participantsObjectStorageMock->expects($this->once())->method('attach')->with($this->equalTo($participant));
Severity: Major
Found in Tests/Unit/Domain/Model/EventTest.php and 1 other location - About 1 hr to fix
Tests/Unit/Domain/Model/EventTest.php on lines 213..222

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

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

    public function removeParticipantFromObjectStorageHoldingParticipants()
    {
        $participant = new \PoiCom\PcEventScheduler\Domain\Model\Participant();
        $participantsObjectStorageMock = $this->getMock('TYPO3\\CMS\\Extbase\\Persistence\\ObjectStorage', array('detach'), array(), '', FALSE);
        $participantsObjectStorageMock->expects($this->once())->method('detach')->with($this->equalTo($participant));
Severity: Major
Found in Tests/Unit/Domain/Model/EventTest.php and 1 other location - About 1 hr to fix
Tests/Unit/Domain/Model/EventTest.php on lines 200..208

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

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

Identical blocks of code found in 5 locations. Consider refactoring.
Open

        if ($this->request->hasArgument('offset')) {
            $offset = $this->request->getArgument('offset');
            if ($offset < 0) {
                $this->addFlashMessage($this->div->translate('message.pastEventError', $this->extensionName), '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
                $this->redirect('list', Null, Null, array('offset'=>$offset));
Severity: Major
Found in Classes/Controller/EventController.php and 4 other locations - About 55 mins to fix
Classes/Controller/EventController.php on lines 112..118
Classes/Controller/EventController.php on lines 165..171
Classes/Controller/EventController.php on lines 283..289
Classes/Controller/EventController.php on lines 316..322

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

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

Identical blocks of code found in 5 locations. Consider refactoring.
Open

        if ($this->request->hasArgument('offset')) {
            $offset = $this->request->getArgument('offset');
            if ($offset < 0) {
                $this->addFlashMessage($this->div->translate('message.pastEventError', $this->extensionName), '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
                $this->redirect('list', Null, Null, array('offset'=>$offset));
Severity: Major
Found in Classes/Controller/EventController.php and 4 other locations - About 55 mins to fix
Classes/Controller/EventController.php on lines 112..118
Classes/Controller/EventController.php on lines 165..171
Classes/Controller/EventController.php on lines 251..257
Classes/Controller/EventController.php on lines 316..322

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

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

Identical blocks of code found in 5 locations. Consider refactoring.
Open

        if ($this->request->hasArgument('offset')) {
            $offset = $this->request->getArgument('offset');
            if ($offset < 0) {
                $this->addFlashMessage($this->div->translate('message.pastEventError', $this->extensionName), '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
                $this->redirect('list', Null, Null, array('offset'=>$offset));
Severity: Major
Found in Classes/Controller/EventController.php and 4 other locations - About 55 mins to fix
Classes/Controller/EventController.php on lines 112..118
Classes/Controller/EventController.php on lines 251..257
Classes/Controller/EventController.php on lines 283..289
Classes/Controller/EventController.php on lines 316..322

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

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

Identical blocks of code found in 5 locations. Consider refactoring.
Open

        if ($this->request->hasArgument('offset')) {
            $offset = $this->request->getArgument('offset');
            if ($offset < 0) {
                $this->addFlashMessage($this->div->translate('message.pastEventError', $this->extensionName), '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
                $this->redirect('list', Null, Null, array('offset'=>$offset));
Severity: Major
Found in Classes/Controller/EventController.php and 4 other locations - About 55 mins to fix
Classes/Controller/EventController.php on lines 112..118
Classes/Controller/EventController.php on lines 165..171
Classes/Controller/EventController.php on lines 251..257
Classes/Controller/EventController.php on lines 283..289

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

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

Identical blocks of code found in 5 locations. Consider refactoring.
Open

        if ($this->request->hasArgument('offset')) {
            $offset = $this->request->getArgument('offset');
            if ($offset < 0) {
                $this->addFlashMessage($this->div->translate('message.pastEventError', $this->extensionName), '', \TYPO3\CMS\Core\Messaging\AbstractMessage::ERROR);
                $this->redirect('list', Null, Null, array('offset'=>$offset));
Severity: Major
Found in Classes/Controller/EventController.php and 4 other locations - About 55 mins to fix
Classes/Controller/EventController.php on lines 165..171
Classes/Controller/EventController.php on lines 251..257
Classes/Controller/EventController.php on lines 283..289
Classes/Controller/EventController.php on lines 316..322

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

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

Severity
Category
Status
Source
Language