Covivo/mobicoop

View on GitHub

Showing 1,612 of 1,620 total issues

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.
 ***************************
api/src/Auth/AdminDataProvider/GrantableRolesDataProvider.php on lines 1..54

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public function post(Proposal $searchProposal): Proposal
    {
        $this->_logger->info('----- POST proposal '.$searchProposal->getId());
        $ad = $this->_buildSearchRequestBody($this->_mobicoopMatcherAdapter->buildAdFromProposal($searchProposal));
        $results = $this->_post(self::ROUTE_POST, $ad);
Severity: Major
Found in api/src/DataProvider/Entity/MobicoopMatcherProvider.php and 1 other location - About 1 hr to fix
api/src/DataProvider/Entity/MobicoopMatcherProvider.php on lines 68..78

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public function checkDriverLicenceNumberValidity(string $driverLicenceNumber)
    {
        $driverLicenceNumberValidation = new DriverLicenceNumberValidation($driverLicenceNumber);
        $driverLicenceNumberValidation->setDriverLicenceNumber($driverLicenceNumber);
        $this->dataProvider->setClass(DriverLicenceNumberValidation::class);
Severity: Major
Found in client/src/MobicoopBundle/User/Service/UserManager.php and 1 other location - About 1 hr to fix
client/src/MobicoopBundle/User/Service/UserManager.php on lines 818..830

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

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

            if ($returnCriteria->isFriCheck() && !is_null($returnCriteria->getFriTime()) && 'multiple' !== $schedule['returnTime']) {
                if (is_null($schedule['returnTime'])) {
                    $schedule['returnTime'] = $returnCriteria->getFriTime()->format('H:i');
                } elseif ($schedule['returnTime'] != $returnCriteria->getFriTime()->format('H:i')) {
                    $schedule['returnTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

            if ($returnCriteria->isSatCheck() && !is_null($returnCriteria->getSatTime()) && 'multiple' !== $schedule['returnTime']) {
                if (is_null($schedule['returnTime'])) {
                    $schedule['returnTime'] = $returnCriteria->getSatTime()->format('H:i');
                } elseif ($schedule['returnTime'] != $returnCriteria->getSatTime()->format('H:i')) {
                    $schedule['returnTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

            if ($returnCriteria->isSunCheck() && !is_null($returnCriteria->getSunTime()) && 'multiple' !== $schedule['returnTime']) {
                if (is_null($schedule['returnTime'])) {
                    $schedule['returnTime'] = $returnCriteria->getSunTime()->format('H:i');
                } elseif ($schedule['returnTime'] != $returnCriteria->getsunTime()->format('H:i')) {
                    $schedule['returnTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481

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

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

        if ($criteria->isWedCheck() && !is_null($criteria->getWedTime()) && 'multiple' !== $schedule['outwardTime']) {
            if (is_null($schedule['outwardTime'])) {
                $schedule['outwardTime'] = $criteria->getWedTime()->format('H:i');
            } elseif ($schedule['outwardTime'] != $criteria->getWedTime()->format('H:i')) {
                $schedule['outwardTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

            if ($returnCriteria->isThuCheck() && !is_null($returnCriteria->getThuTime()) && 'multiple' !== $schedule['returnTime']) {
                if (is_null($schedule['returnTime'])) {
                    $schedule['returnTime'] = $returnCriteria->getThuTime()->format('H:i');
                } elseif ($schedule['returnTime'] != $returnCriteria->getThuTime()->format('H:i')) {
                    $schedule['returnTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

        if ($criteria->isFriCheck() && !is_null($criteria->getFriTime()) && 'multiple' !== $schedule['outwardTime']) {
            if (is_null($schedule['outwardTime'])) {
                $schedule['outwardTime'] = $criteria->getFriTime()->format('H:i');
            } elseif ($schedule['outwardTime'] != $criteria->getFriTime()->format('H:i')) {
                $schedule['outwardTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

            if ($returnCriteria->isWedCheck() && !is_null($returnCriteria->getWedTime()) && 'multiple' !== $schedule['returnTime']) {
                if (is_null($schedule['returnTime'])) {
                    $schedule['returnTime'] = $returnCriteria->getWedTime()->format('H:i');
                } elseif ($schedule['returnTime'] != $returnCriteria->getWedTime()->format('H:i')) {
                    $schedule['returnTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

        if ($criteria->isSunCheck() && !is_null($criteria->getSunTime()) && 'multiple' !== $schedule['outwardTime']) {
            if (is_null($schedule['outwardTime'])) {
                $schedule['outwardTime'] = $criteria->getSunTime()->format('H:i');
            } elseif ($schedule['outwardTime'] != $criteria->getSunTime()->format('H:i')) {
                $schedule['outwardTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

        if ($criteria->isThuCheck() && !is_null($criteria->getThuTime()) && 'multiple' !== $schedule['outwardTime']) {
            if (is_null($schedule['outwardTime'])) {
                $schedule['outwardTime'] = $criteria->getThuTime()->format('H:i');
            } elseif ($schedule['outwardTime'] != $criteria->getThuTime()->format('H:i')) {
                $schedule['outwardTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 428..434
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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

        if ($criteria->isSatCheck() && !is_null($criteria->getSatTime()) && 'multiple' !== $schedule['outwardTime']) {
            if (is_null($schedule['outwardTime'])) {
                $schedule['outwardTime'] = $criteria->getSatTime()->format('H:i');
            } elseif ($schedule['outwardTime'] != $criteria->getSatTime()->format('H:i')) {
                $schedule['outwardTime'] = 'multiple';
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 9 other locations - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 407..413
api/src/Carpool/Service/MyAdManager.php on lines 414..420
api/src/Carpool/Service/MyAdManager.php on lines 421..427
api/src/Carpool/Service/MyAdManager.php on lines 435..441
api/src/Carpool/Service/MyAdManager.php on lines 454..460
api/src/Carpool/Service/MyAdManager.php on lines 461..467
api/src/Carpool/Service/MyAdManager.php on lines 468..474
api/src/Carpool/Service/MyAdManager.php on lines 475..481
api/src/Carpool/Service/MyAdManager.php on lines 482..488

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

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.
api/src/Import/Admin/Service/Validator/EmptyOrPostalCodeValidator.php on lines 1..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 104.

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.
api/src/Import/Admin/Service/Validator/EmptyOrDescriptionValidator.php on lines 1..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 104.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public function jsonSerialize()
    {
        return
        [
            'id' => $this->getId(),
client/src/MobicoopBundle/Carpool/Entity/Proposal.php on lines 583..601

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

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

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

    public function jsonSerialize()
    {
        return
        [
            'id'                        => $this->getId(),
Severity: Major
Found in client/src/MobicoopBundle/Carpool/Entity/Proposal.php and 1 other location - About 1 hr to fix
client/src/MobicoopBundle/RelayPoint/Entity/RelayPointMap.php on lines 237..254

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

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

                } else {
                    $ad->setFrequency(Criteria::FREQUENCY_PUNCTUAL);
                    $ad->setOutwardDate(\DateTime::createFromFormat('Y-m-d', $outward['mindate']));
                    (isset($outward['maxdate'])) ? $ad->setOutwardLimitDate(\DateTime::createFromFormat('Y-m-d', $outward['maxdate'])) : '';

Severity: Major
Found in api/src/Carpool/Service/AdManager.php and 1 other location - About 1 hr to fix
api/src/Carpool/Service/AdManager.php on lines 1759..1786

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

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

                    $waypoints[] = [
                        'position' => $waypoint->getPosition(),
                        'destination' => $waypoint->isDestination(),
                        'houseNumber' => $waypoint->getAddress()->getHouseNumber(),
                        'street' => $waypoint->getAddress()->getStreet(),
Severity: Major
Found in api/src/Carpool/Service/MyAdManager.php and 1 other location - About 1 hr to fix
api/src/Carpool/Service/MyAdManager.php on lines 1287..1297

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

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

        try {
            $this->_apiProvider->patchSubscription($this->_subscription, $httpQueryParams);
        } catch (HttpException $exception) {
            $this->_subscription->addLog($exception, Log::TYPE_ATTESTATION, $httpQueryParams);

Severity: Major
Found in api/src/Incentive/Service/Stage/ValidateSDSubscription.php and 1 other location - About 1 hr to fix
api/src/Incentive/Service/Stage/ValidateLDSubscription.php on lines 157..170

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

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