Covivo/mobicoop

View on GitHub

Showing 1,455 of 1,620 total issues

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

    public function findPendingAsksForPeriod(\DateTime $fromDate, \DateTime $toDate, ?User $user = null)
    {
        // we will need the different week number days between fromDate and toDate
        $days = [];
        $curDate = clone $fromDate;
Severity: Major
Found in api/src/Carpool/Repository/AskRepository.php and 1 other location - About 2 days to fix
api/src/Carpool/Repository/AskRepository.php on lines 129..217

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

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

<?php

/**
 * Copyright (c) 2020, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/Solidary/Security/SolidaryBeneficiaryVoter.php and 5 other locations - About 2 days to fix
api/src/Action/Security/ActionVoter.php on lines 1..120
api/src/Editorial/Security/EditorialVoter.php on lines 1..116
api/src/Solidary/Security/ProofVoter.php on lines 1..118
api/src/Solidary/Security/SolidaryUserStructureVoter.php on lines 1..118
api/src/Solidary/Security/SubjectVoter.php on lines 1..118

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

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 6 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/Editorial/Security/EditorialVoter.php and 5 other locations - About 2 days to fix
api/src/Action/Security/ActionVoter.php on lines 1..120
api/src/Solidary/Security/ProofVoter.php on lines 1..118
api/src/Solidary/Security/SolidaryBeneficiaryVoter.php on lines 1..120
api/src/Solidary/Security/SolidaryUserStructureVoter.php on lines 1..118
api/src/Solidary/Security/SubjectVoter.php on lines 1..118

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

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

<?php

/**
 * Copyright (c) 2020, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/Solidary/Security/ProofVoter.php and 5 other locations - About 2 days to fix
api/src/Action/Security/ActionVoter.php on lines 1..120
api/src/Editorial/Security/EditorialVoter.php on lines 1..116
api/src/Solidary/Security/SolidaryBeneficiaryVoter.php on lines 1..120
api/src/Solidary/Security/SolidaryUserStructureVoter.php on lines 1..118
api/src/Solidary/Security/SubjectVoter.php on lines 1..118

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

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

<?php

/**
 * Copyright (c) 2020, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/Solidary/Security/SolidaryUserStructureVoter.php and 5 other locations - About 2 days to fix
api/src/Action/Security/ActionVoter.php on lines 1..120
api/src/Editorial/Security/EditorialVoter.php on lines 1..116
api/src/Solidary/Security/ProofVoter.php on lines 1..118
api/src/Solidary/Security/SolidaryBeneficiaryVoter.php on lines 1..120
api/src/Solidary/Security/SubjectVoter.php on lines 1..118

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

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

<?php

/**
 * Copyright (c) 2020, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/Solidary/Security/SubjectVoter.php and 5 other locations - About 2 days to fix
api/src/Action/Security/ActionVoter.php on lines 1..120
api/src/Editorial/Security/EditorialVoter.php on lines 1..116
api/src/Solidary/Security/ProofVoter.php on lines 1..118
api/src/Solidary/Security/SolidaryBeneficiaryVoter.php on lines 1..120
api/src/Solidary/Security/SolidaryUserStructureVoter.php on lines 1..118

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

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

<?php

/**
 * Copyright (c) 2020, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/Action/Security/ActionVoter.php and 5 other locations - About 2 days to fix
api/src/Editorial/Security/EditorialVoter.php on lines 1..116
api/src/Solidary/Security/ProofVoter.php on lines 1..118
api/src/Solidary/Security/SolidaryBeneficiaryVoter.php on lines 1..120
api/src/Solidary/Security/SolidaryUserStructureVoter.php on lines 1..118
api/src/Solidary/Security/SubjectVoter.php on lines 1..118

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

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

/**
 * Copyright (c) 2020, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/MassCommunication/Security/CampaignVoter.php and 2 other locations - About 2 days to fix
api/src/RelayPoint/Security/RelayPointTypeVoter.php on lines 1..113
api/src/RelayPoint/Security/RelayPointVoter.php on lines 1..113

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

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

/**
 * Copyright (c) 2020, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/RelayPoint/Security/RelayPointTypeVoter.php and 2 other locations - About 2 days to fix
api/src/MassCommunication/Security/CampaignVoter.php on lines 1..113
api/src/RelayPoint/Security/RelayPointVoter.php on lines 1..113

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

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

/**
 * Copyright (c) 2020, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
Severity: Major
Found in api/src/RelayPoint/Security/RelayPointVoter.php and 2 other locations - About 2 days to fix
api/src/MassCommunication/Security/CampaignVoter.php on lines 1..113
api/src/RelayPoint/Security/RelayPointTypeVoter.php on lines 1..113

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

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) 2020, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
 ***************************
Severity: Major
Found in api/src/Event/Filter/TerritoryFilter.php and 1 other location - About 2 days to fix
api/src/Community/Filter/TerritoryFilter.php on lines 1..100

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

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) 2020, MOBICOOP. All rights reserved.
 * This project is dual licensed under AGPL and proprietary licence.
 ***************************
Severity: Major
Found in api/src/Community/Filter/TerritoryFilter.php and 1 other location - About 2 days to fix
api/src/Event/Filter/TerritoryFilter.php on lines 1..100

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

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 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/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/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 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 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->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->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

Severity
Category
Status
Source
Language