Covivo/mobicoop

View on GitHub

Showing 1,612 of 1,620 total issues

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

                case RelayPoint::class:
                    if (!file_exists(dirname(__FILE__).'/../../../public/upload/relaypoints/images/'.$image->getFileName())) {
                        $this->loggerMaintenance->info('ImageManager : remove image '.$image->getFileName().' without associated file of the RelayPoint n°'.$owner->getId().' .'.(new \DateTime('UTC'))->format('Ymd H:i:s.u'));
                        $this->deleteVersions($image);
                        $this->deleteBase($image, false);
Severity: Major
Found in api/src/Image/Service/ImageManager.php and 7 other locations - About 1 hr to fix
api/src/Image/Service/ImageManager.php on lines 482..489
api/src/Image/Service/ImageManager.php on lines 491..498
api/src/Image/Service/ImageManager.php on lines 509..516
api/src/Image/Service/ImageManager.php on lines 518..525
api/src/Image/Service/ImageManager.php on lines 527..534
api/src/Image/Service/ImageManager.php on lines 536..543
api/src/Image/Service/ImageManager.php on lines 545..552

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

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

            if (isset($matching->getFilters()['pickup']['monMinPickupTime'], $matching->getFilters()['pickup']['monMaxPickupTime'])) {
                $matchingCriteria->setMonCheck(true);
                $matchingCriteria->setMonMinTime($matching->getProposalOffer()->getCriteria()->getMonMinTime());
                $matchingCriteria->setMonMaxTime($matching->getProposalOffer()->getCriteria()->getMonMaxTime());
                $matchingCriteria->setMonMarginDuration($matching->getProposalOffer()->getCriteria()->getMonMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

                if (isset($matching->getFilters()['pickup']['monMinPickupTime'], $matching->getFilters()['pickup']['monMaxPickupTime'])) {
                    $matchingCriteria->setMonCheck(true);
                    $matchingCriteria->setMonMinTime($matching->getProposalOffer()->getCriteria()->getMonMinTime());
                    $matchingCriteria->setMonMaxTime($matching->getProposalOffer()->getCriteria()->getMonMaxTime());
                    $matchingCriteria->setMonMarginDuration($matching->getProposalOffer()->getCriteria()->getMonMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

                case Structure::class:
                    if (!file_exists(dirname(__FILE__).'/../../../public/upload/structures/images/'.$image->getFileName())) {
                        $this->loggerMaintenance->info('ImageManager : remove image '.$image->getFileName().' without associated file of the Structure n°'.$owner->getId().' .'.(new \DateTime('UTC'))->format('Ymd H:i:s.u'));
                        $this->deleteVersions($image);
                        $this->deleteBase($image, false);
Severity: Major
Found in api/src/Image/Service/ImageManager.php and 7 other locations - About 1 hr to fix
api/src/Image/Service/ImageManager.php on lines 482..489
api/src/Image/Service/ImageManager.php on lines 491..498
api/src/Image/Service/ImageManager.php on lines 500..507
api/src/Image/Service/ImageManager.php on lines 509..516
api/src/Image/Service/ImageManager.php on lines 518..525
api/src/Image/Service/ImageManager.php on lines 527..534
api/src/Image/Service/ImageManager.php on lines 536..543

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

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

                if (isset($matching->getFilters()['pickup']['wedMinPickupTime'], $matching->getFilters()['pickup']['wedMaxPickupTime'])) {
                    $matchingCriteria->setWedCheck(true);
                    $matchingCriteria->setWedMinTime($matching->getProposalOffer()->getCriteria()->getWedMinTime());
                    $matchingCriteria->setWedMaxTime($matching->getProposalOffer()->getCriteria()->getWedMaxTime());
                    $matchingCriteria->setWedMarginDuration($matching->getProposalOffer()->getCriteria()->getWedMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

                if (isset($matching->getFilters()['pickup']['sunMinPickupTime'], $matching->getFilters()['pickup']['sunMaxPickupTime'])) {
                    $matchingCriteria->setSunCheck(true);
                    $matchingCriteria->setSunMinTime($matching->getProposalOffer()->getCriteria()->getSunMinTime());
                    $matchingCriteria->setSunMaxTime($matching->getProposalOffer()->getCriteria()->getSunMaxTime());
                    $matchingCriteria->setSunMarginDuration($matching->getProposalOffer()->getCriteria()->getSunMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435

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

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

                case Campaign::class:
                    if (!file_exists(dirname(__FILE__).'/../../../public/upload/masscommunication/images/'.$image->getFileName())) {
                        $this->loggerMaintenance->info('ImageManager : remove image '.$image->getFileName().' without associated file of the Campaign n°'.$owner->getId().' .'.(new \DateTime('UTC'))->format('Ymd H:i:s.u'));
                        $this->deleteVersions($image);
                        $this->deleteBase($image, false);
Severity: Major
Found in api/src/Image/Service/ImageManager.php and 7 other locations - About 1 hr to fix
api/src/Image/Service/ImageManager.php on lines 482..489
api/src/Image/Service/ImageManager.php on lines 491..498
api/src/Image/Service/ImageManager.php on lines 500..507
api/src/Image/Service/ImageManager.php on lines 509..516
api/src/Image/Service/ImageManager.php on lines 527..534
api/src/Image/Service/ImageManager.php on lines 536..543
api/src/Image/Service/ImageManager.php on lines 545..552

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

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

            if (isset($matching->getFilters()['pickup']['wedMinPickupTime'], $matching->getFilters()['pickup']['wedMaxPickupTime'])) {
                $matchingCriteria->setWedCheck(true);
                $matchingCriteria->setWedMinTime($matching->getProposalOffer()->getCriteria()->getWedMinTime());
                $matchingCriteria->setWedMaxTime($matching->getProposalOffer()->getCriteria()->getWedMaxTime());
                $matchingCriteria->setWedMarginDuration($matching->getProposalOffer()->getCriteria()->getWedMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

            if (isset($matching->getFilters()['pickup']['tueMinPickupTime'], $matching->getFilters()['pickup']['tueMaxPickupTime'])) {
                $matchingCriteria->setTueCheck(true);
                $matchingCriteria->setTueMinTime($matching->getProposalOffer()->getCriteria()->getTueMinTime());
                $matchingCriteria->setTueMaxTime($matching->getProposalOffer()->getCriteria()->getTueMaxTime());
                $matchingCriteria->setTueMarginDuration($matching->getProposalOffer()->getCriteria()->getTueMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

                case Event::class:
                    if (!file_exists(dirname(__FILE__).'/../../../public/upload/events/images/'.$image->getFileName())) {
                        $this->loggerMaintenance->info('ImageManager : remove image '.$image->getFileName().' without associated file of the Event n°'.$owner->getId().' .'.(new \DateTime('UTC'))->format('Ymd H:i:s.u'));
                        $this->deleteVersions($image);
                        $this->deleteBase($image, false);
Severity: Major
Found in api/src/Image/Service/ImageManager.php and 7 other locations - About 1 hr to fix
api/src/Image/Service/ImageManager.php on lines 491..498
api/src/Image/Service/ImageManager.php on lines 500..507
api/src/Image/Service/ImageManager.php on lines 509..516
api/src/Image/Service/ImageManager.php on lines 518..525
api/src/Image/Service/ImageManager.php on lines 527..534
api/src/Image/Service/ImageManager.php on lines 536..543
api/src/Image/Service/ImageManager.php on lines 545..552

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

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

            if (isset($matching->getFilters()['pickup']['sunMinPickupTime'], $matching->getFilters()['pickup']['sunMaxPickupTime'])) {
                $matchingCriteria->setSunCheck(true);
                $matchingCriteria->setSunMinTime($matching->getProposalOffer()->getCriteria()->getSunMinTime());
                $matchingCriteria->setSunMaxTime($matching->getProposalOffer()->getCriteria()->getSunMaxTime());
                $matchingCriteria->setSunMarginDuration($matching->getProposalOffer()->getCriteria()->getSunMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

                case User::class:
                    if (!file_exists(dirname(__FILE__).'/../../../public/upload/users/images/'.$image->getFileName())) {
                        $this->loggerMaintenance->info('ImageManager : remove image '.$image->getFileName().' without associated file of the User n°'.$owner->getId().' .'.(new \DateTime('UTC'))->format('Ymd H:i:s.u'));
                        $this->deleteVersions($image);
                        $this->deleteBase($image, false);
Severity: Major
Found in api/src/Image/Service/ImageManager.php and 7 other locations - About 1 hr to fix
api/src/Image/Service/ImageManager.php on lines 482..489
api/src/Image/Service/ImageManager.php on lines 491..498
api/src/Image/Service/ImageManager.php on lines 500..507
api/src/Image/Service/ImageManager.php on lines 518..525
api/src/Image/Service/ImageManager.php on lines 527..534
api/src/Image/Service/ImageManager.php on lines 536..543
api/src/Image/Service/ImageManager.php on lines 545..552

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

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

                case Community::class:
                    if (!file_exists(dirname(__FILE__).'/../../../public/upload/communities/images/'.$image->getFileName())) {
                        $this->loggerMaintenance->info('ImageManager : remove image '.$image->getFileName().' without associated file of the Community n°'.$owner->getId().' .'.(new \DateTime('UTC'))->format('Ymd H:i:s.u'));
                        $this->deleteVersions($image);
                        $this->deleteBase($image, false);
Severity: Major
Found in api/src/Image/Service/ImageManager.php and 7 other locations - About 1 hr to fix
api/src/Image/Service/ImageManager.php on lines 482..489
api/src/Image/Service/ImageManager.php on lines 500..507
api/src/Image/Service/ImageManager.php on lines 509..516
api/src/Image/Service/ImageManager.php on lines 518..525
api/src/Image/Service/ImageManager.php on lines 527..534
api/src/Image/Service/ImageManager.php on lines 536..543
api/src/Image/Service/ImageManager.php on lines 545..552

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

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

                if (isset($matching->getFilters()['pickup']['satMinPickupTime'], $matching->getFilters()['pickup']['satMaxPickupTime'])) {
                    $matchingCriteria->setSatCheck(true);
                    $matchingCriteria->setSatMinTime($matching->getProposalOffer()->getCriteria()->getSatMinTime());
                    $matchingCriteria->setSatMaxTime($matching->getProposalOffer()->getCriteria()->getSatMaxTime());
                    $matchingCriteria->setSatMarginDuration($matching->getProposalOffer()->getCriteria()->getSatMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

                if (isset($matching->getFilters()['pickup']['tueMinPickupTime'], $matching->getFilters()['pickup']['tueMaxPickupTime'])) {
                    $matchingCriteria->setTueCheck(true);
                    $matchingCriteria->setTueMinTime($matching->getProposalOffer()->getCriteria()->getTueMinTime());
                    $matchingCriteria->setTueMaxTime($matching->getProposalOffer()->getCriteria()->getTueMaxTime());
                    $matchingCriteria->setTueMarginDuration($matching->getProposalOffer()->getCriteria()->getTueMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 856..862
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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

            if (isset($matching->getFilters()['pickup']['friMinPickupTime'], $matching->getFilters()['pickup']['friMaxPickupTime'])) {
                $matchingCriteria->setFriCheck(true);
                $matchingCriteria->setFriMinTime($matching->getProposalOffer()->getCriteria()->getFriMinTime());
                $matchingCriteria->setFriMaxTime($matching->getProposalOffer()->getCriteria()->getFriMaxTime());
                $matchingCriteria->setFriMarginDuration($matching->getProposalOffer()->getCriteria()->getFriMarginDuration());
Severity: Major
Found in api/src/Carpool/Service/ProposalMatcher.php and 13 other locations - About 1 hr to fix
api/src/Carpool/Service/ProposalMatcher.php on lines 828..834
api/src/Carpool/Service/ProposalMatcher.php on lines 835..841
api/src/Carpool/Service/ProposalMatcher.php on lines 842..848
api/src/Carpool/Service/ProposalMatcher.php on lines 849..855
api/src/Carpool/Service/ProposalMatcher.php on lines 863..869
api/src/Carpool/Service/ProposalMatcher.php on lines 870..876
api/src/Carpool/Service/ProposalMatcher.php on lines 1394..1400
api/src/Carpool/Service/ProposalMatcher.php on lines 1401..1407
api/src/Carpool/Service/ProposalMatcher.php on lines 1408..1414
api/src/Carpool/Service/ProposalMatcher.php on lines 1415..1421
api/src/Carpool/Service/ProposalMatcher.php on lines 1422..1428
api/src/Carpool/Service/ProposalMatcher.php on lines 1429..1435
api/src/Carpool/Service/ProposalMatcher.php on lines 1436..1442

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

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 execute(InputInterface $input, OutputInterface $output)
    {
        $this->_currentInput = $input;

        $subscriptionType = $this->_currentInput->getOption('type');
Severity: Major
Found in api/src/Incentive/Command/SubscriptionCommitCommand.php and 1 other location - About 1 hr to fix
api/src/Incentive/Command/SubscriptionUpdateCommand.php on lines 31..46

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

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

/**
 * Copyright (c) 2021, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/Gamification/EventSubscriber/LogSubscriber.php and 1 other location - About 1 hr to fix
api/src/Gratuity/EventSubscriber/LogSubscriber.php on lines 1..57

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

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

/**
 * Copyright (c) 2023, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/Gratuity/EventSubscriber/LogSubscriber.php and 1 other location - About 1 hr to fix
api/src/Gamification/EventSubscriber/LogSubscriber.php on lines 1..57

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

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 execute(InputInterface $input, OutputInterface $output)
    {
        $this->_currentInput = $input;

        $subscriptionType = $this->_currentInput->getOption('type');
Severity: Major
Found in api/src/Incentive/Command/SubscriptionUpdateCommand.php and 1 other location - About 1 hr to fix
api/src/Incentive/Command/SubscriptionCommitCommand.php on lines 32..47

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

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