Covivo/mobicoop

View on GitHub

Showing 1,607 of 1,615 total issues

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

<?php declare(strict_types=1);

/**
 * Copyright (c) 2018, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/Migrations/Version20190324101155.php and 3 other locations - About 2 days to fix
api/src/Migrations/Version20190324085946.php on lines 1..85
api/src/Migrations/Version20190324094740.php on lines 1..85
api/src/Migrations/Version20190324100234.php on lines 1..85

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

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 declare(strict_types=1);

/**
 * Copyright (c) 2018, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/Migrations/Version20190324085946.php and 3 other locations - About 2 days to fix
api/src/Migrations/Version20190324094740.php on lines 1..85
api/src/Migrations/Version20190324100234.php on lines 1..85
api/src/Migrations/Version20190324101155.php on lines 1..85

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

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 declare(strict_types=1);

/**
 * Copyright (c) 2018, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/Migrations/Version20190324100234.php and 3 other locations - About 2 days to fix
api/src/Migrations/Version20190324085946.php on lines 1..85
api/src/Migrations/Version20190324094740.php on lines 1..85
api/src/Migrations/Version20190324101155.php on lines 1..85

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

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 declare(strict_types=1);

/**
 * Copyright (c) 2018, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/Migrations/Version20190324094740.php and 3 other locations - About 2 days to fix
api/src/Migrations/Version20190324085946.php on lines 1..85
api/src/Migrations/Version20190324100234.php on lines 1..85
api/src/Migrations/Version20190324101155.php on lines 1..85

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

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

            if ((($outwardResult->getMonTime() && $askConcerned->getCriteria()->isMonCheck()) ? $outwardResult->getMonTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getMonTime() && $askLinkedConcerned->getCriteria()->isMonCheck()) ? $returnResult->getMonTime()->format('H:i') : 'null') == $time) {
                // outward
                $outwardDriverDepartureTime = ($outwardResult->getMonTime() && $askConcerned->getCriteria()->isMonCheck()) ? clone $outwardResult->getMonTime() : null;
                $schedule['outwardPickUpTime'] = $outwardDriverDepartureTime ? $outwardDriverDepartureTime->modify('+'.$askConcerned->getMatching()->getPickUpDuration().' seconds') : null;
                $outwardDriverDepartureTime = ($outwardResult->getMonTime() && $askConcerned->getCriteria()->isMonCheck()) ? clone $outwardResult->getMonTime() : null;
Severity: Major
Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 2 days to fix
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 541..553
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 554..566
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 567..579
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 580..592
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 593..605
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 606..618

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

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

            if ((($outwardResult->getThuTime() && $askConcerned->getCriteria()->isThuCheck()) ? $outwardResult->getThuTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getThuTime() && $askLinkedConcerned->getCriteria()->isThuCheck()) ? $returnResult->getThuTime()->format('H:i') : 'null') == $time) {
                // outward
                $outwardDriverDepartureTime = ($outwardResult->getThuTime() && $askConcerned->getCriteria()->isThuCheck()) ? clone $outwardResult->getThuTime() : null;
                $schedule['outwardPickUpTime'] = $outwardDriverDepartureTime ? $outwardDriverDepartureTime->modify('+'.$askConcerned->getMatching()->getPickUpDuration().' seconds') : null;
                $outwardDriverDepartureTime = ($outwardResult->getThuTime() && $askConcerned->getCriteria()->isThuCheck()) ? clone $outwardResult->getThuTime() : null;
Severity: Major
Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 2 days to fix
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 528..540
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 541..553
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 554..566
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 580..592
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 593..605
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 606..618

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

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

            if ((($outwardResult->getWedTime() && $askConcerned->getCriteria()->isWedCheck()) ? $outwardResult->getWedTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getWedTime() && $askLinkedConcerned->getCriteria()->isWedCheck()) ? $returnResult->getWedTime()->format('H:i') : 'null') == $time) {
                // outward
                $outwardDriverDepartureTime = ($outwardResult->getWedTime() && $askConcerned->getCriteria()->isWedCheck()) ? clone $outwardResult->getWedTime() : null;
                $schedule['outwardPickUpTime'] = $outwardDriverDepartureTime ? $outwardDriverDepartureTime->modify('+'.$askConcerned->getMatching()->getPickUpDuration().' seconds') : null;
                $outwardDriverDepartureTime = ($outwardResult->getWedTime() && $askConcerned->getCriteria()->isWedCheck()) ? clone $outwardResult->getWedTime() : null;
Severity: Major
Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 2 days to fix
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 528..540
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 541..553
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 567..579
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 580..592
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 593..605
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 606..618

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

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

            if ((($outwardResult->getFriTime() && $askConcerned->getCriteria()->isFriCheck()) ? $outwardResult->getFriTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getFriTime() && $askLinkedConcerned->getCriteria()->isFriCheck()) ? $returnResult->getFriTime()->format('H:i') : 'null') == $time) {
                // outward
                $outwardDriverDepartureTime = ($outwardResult->getFriTime() && $askConcerned->getCriteria()->isFriCheck()) ? clone $outwardResult->getFriTime() : null;
                $schedule['outwardPickUpTime'] = $outwardDriverDepartureTime ? $outwardDriverDepartureTime->modify('+'.$askConcerned->getMatching()->getPickUpDuration().' seconds') : null;
                $outwardDriverDepartureTime = ($outwardResult->getFriTime() && $askConcerned->getCriteria()->isFriCheck()) ? clone $outwardResult->getFriTime() : null;
Severity: Major
Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 2 days to fix
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 528..540
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 541..553
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 554..566
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 567..579
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 593..605
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 606..618

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

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

            if ((($outwardResult->getTueTime() && $askConcerned->getCriteria()->isTueCheck()) ? $outwardResult->getTueTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getTueTime() && $askLinkedConcerned->getCriteria()->isTueCheck()) ? $returnResult->getTueTime()->format('H:i') : 'null') == $time) {
                // outward
                $outwardDriverDepartureTime = ($outwardResult->getTueTime() && $askConcerned->getCriteria()->isTueCheck()) ? clone $outwardResult->getTueTime() : null;
                $schedule['outwardPickUpTime'] = $outwardDriverDepartureTime ? $outwardDriverDepartureTime->modify('+'.$askConcerned->getMatching()->getPickUpDuration().' seconds') : null;
                $outwardDriverDepartureTime = ($outwardResult->getTueTime() && $askConcerned->getCriteria()->isTueCheck()) ? clone $outwardResult->getTueTime() : null;
Severity: Major
Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 2 days to fix
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 528..540
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 554..566
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 567..579
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 580..592
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 593..605
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 606..618

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

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

            if ((($outwardResult->getSunTime() && $askConcerned->getCriteria()->isSunCheck()) ? $outwardResult->getSunTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getSunTime() && $askLinkedConcerned->getCriteria()->isSunCheck()) ? $returnResult->getSunTime()->format('H:i') : 'null') == $time) {
                // outward
                $outwardDriverDepartureTime = ($outwardResult->getSunTime() && $askConcerned->getCriteria()->isSunCheck()) ? clone $outwardResult->getSunTime() : null;
                $schedule['outwardPickUpTime'] = $outwardDriverDepartureTime ? $outwardDriverDepartureTime->modify('+'.$askConcerned->getMatching()->getPickUpDuration().' seconds') : null;
                $outwardDriverDepartureTime = ($outwardResult->getSunTime() && $askConcerned->getCriteria()->isSunCheck()) ? clone $outwardResult->getSunTime() : null;
Severity: Major
Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 2 days to fix
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 528..540
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 541..553
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 554..566
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 567..579
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 580..592
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 593..605

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

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

            if ((($outwardResult->getSatTime() && $askConcerned->getCriteria()->isSatCheck()) ? $outwardResult->getSatTime()->format('H:i') : 'null').' '.((!is_null($askLinkedConcerned) && $returnResult->getSatTime() && $askLinkedConcerned->getCriteria()->isSatCheck()) ? $returnResult->getSatTime()->format('H:i') : 'null') == $time) {
                // outward
                $outwardDriverDepartureTime = ($outwardResult->getSatTime() && $askConcerned->getCriteria()->isSatCheck()) ? clone $outwardResult->getSatTime() : null;
                $schedule['outwardPickUpTime'] = $outwardDriverDepartureTime ? $outwardDriverDepartureTime->modify('+'.$askConcerned->getMatching()->getPickUpDuration().' seconds') : null;
                $outwardDriverDepartureTime = ($outwardResult->getSatTime() && $askConcerned->getCriteria()->isSatCheck()) ? clone $outwardResult->getSatTime() : null;
Severity: Major
Found in api/src/Communication/EventSubscriber/CarpoolSubscriber.php and 6 other locations - About 2 days to fix
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 528..540
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 541..553
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 554..566
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 567..579
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 580..592
api/src/Communication/EventSubscriber/CarpoolSubscriber.php on lines 606..618

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

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

        if (isset($data["ArrivalTime"])) {
            $arrival = new PTArrival(1); // we have to set an id as it's mandatory when using a custom data provider (see https://api-platform.com/docs/core/data-providers)
            $arrival->setDate(\DateTime::createFromFormat(self::DATETIME_OUTPUT_FORMAT, $data["ArrivalTime"]));
            if (isset($data["Arrival"]["Site"])) {
                $arrivalAddress = new Address();
Severity: Major
Found in api/src/DataProvider/Entity/CitywayProvider.php and 1 other location - About 2 days to fix
api/src/DataProvider/Entity/CitywayProvider.php on lines 489..513

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

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

        if (isset($data["DepartureTime"])) {
            $departure = new PTDeparture(1); // we have to set an id as it's mandatory when using a custom data provider (see https://api-platform.com/docs/core/data-providers)
            $departure->setDate(\DateTime::createFromFormat(self::DATETIME_OUTPUT_FORMAT, $data["DepartureTime"]));
            if (isset($data["Departure"]["Site"])) {
                $departureAddress = new Address();
Severity: Major
Found in api/src/DataProvider/Entity/CitywayProvider.php and 1 other location - About 2 days to fix
api/src/DataProvider/Entity/CitywayProvider.php on lines 514..538

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

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

<?php

/**
 * Copyright (c) 2018, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in client/src/Kernel.php and 1 other location - About 2 days to fix
api/src/Kernel.php on lines 1..82

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

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

<?php

/**
 * Copyright (c) 2018, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/Kernel.php and 1 other location - About 2 days to fix
client/src/Kernel.php on lines 1..82

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

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

            if (Criteria::FREQUENCY_REGULAR == $ad->getFrequency()) {
                $returnCriteria->setFrequency(Criteria::FREQUENCY_REGULAR);
                $returnCriteria->setToDate($ad->getReturnLimitDate() ? $ad->getReturnLimitDate() : null);
                $returnCriteria = $this->createTimesFromSchedule($ad->getSchedule(), $returnCriteria, 'returnTime', $marginDuration);
                $hasSchedule = $returnCriteria->isMonCheck() || $returnCriteria->isTueCheck()
Severity: Major
Found in api/src/Carpool/Service/AdManager.php and 1 other location - About 2 days to fix
api/src/Carpool/Service/AdManager.php on lines 2139..2178

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

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

        if (Criteria::FREQUENCY_REGULAR == $ad->getFrequency()) {
            $outwardCriteria->setFrequency(Criteria::FREQUENCY_REGULAR);
            $outwardCriteria->setToDate($ad->getOutwardLimitDate() ? $ad->getOutwardLimitDate() : null);
            $outwardCriteria = $this->createTimesFromSchedule($ad->getSchedule(), $outwardCriteria, 'outwardTime', $marginDuration);
            $hasSchedule = $outwardCriteria->isMonCheck() || $outwardCriteria->isTueCheck()
Severity: Major
Found in api/src/Carpool/Service/AdManager.php and 1 other location - About 2 days to fix
api/src/Carpool/Service/AdManager.php on lines 2232..2271

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

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

SolidaryVolunteer has 105 functions (exceeds 20 allowed). Consider refactoring.
Open

class SolidaryVolunteer
{
    const DEFAULT_ID = 999999999999;
    const TYPE = "volunteer";
    const AUTHORIZED_GENERIC_FILTERS = ['familyName','givenName','email'];
Severity: Major
Found in api/src/Solidary/Entity/SolidaryVolunteer.php - About 2 days to fix

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

                if (Ad::ROLE_DRIVER_OR_PASSENGER != $ad->getRole()) {
                    foreach ($ad->getSchedule() as $schedule) {
                        if (isset($schedule['returnTime']) && '' != $schedule['returnTime']) {
                            if (isset($schedule['mon']) && $schedule['mon']) {
                                $criteriaReturn->setMonCheck(true);
    Severity: Major
    Found in api/src/Carpool/Service/AskManager.php and 1 other location - About 1 day to fix
    api/src/Carpool/Service/AskManager.php on lines 228..262

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

    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

                if (Ad::ROLE_DRIVER_OR_PASSENGER != $ad->getRole()) {
                    // we fill the selected days if a role has been set
                    foreach ($ad->getSchedule() as $schedule) {
                        if (isset($schedule['outwardTime']) && '' != $schedule['outwardTime']) {
                            if (isset($schedule['mon']) && $schedule['mon']) {
    Severity: Major
    Found in api/src/Carpool/Service/AskManager.php and 1 other location - About 1 day to fix
    api/src/Carpool/Service/AskManager.php on lines 374..407

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

    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