Covivo/mobicoop

View on GitHub

Showing 1,612 of 1,620 total issues

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

<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
Severity: Major
Found in api/src/Migrations/Version20200709134600.php and 11 other locations - About 4 hrs to fix
api/src/Migrations/Version20180921094924.php on lines 1..57
api/src/Migrations/Version20190514153722.php on lines 1..36
api/src/Migrations/Version20190527073022.php on lines 1..36
api/src/Migrations/Version20191127171355.php on lines 1..36
api/src/Migrations/Version20200320074704.php on lines 1..36
api/src/Migrations/Version20200325162657.php on lines 1..36
api/src/Migrations/Version20200506115046.php on lines 1..36
api/src/Migrations/Version20200506142524.php on lines 1..36
api/src/Migrations/Version20200515095252.php on lines 1..36
api/src/Migrations/Version20210625084030.php on lines 1..36
api/src/Migrations/Version20230118150956.php on lines 1..36

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

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

<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
Severity: Major
Found in api/src/Migrations/Version20200515095252.php and 11 other locations - About 4 hrs to fix
api/src/Migrations/Version20180921094924.php on lines 1..57
api/src/Migrations/Version20190514153722.php on lines 1..36
api/src/Migrations/Version20190527073022.php on lines 1..36
api/src/Migrations/Version20191127171355.php on lines 1..36
api/src/Migrations/Version20200320074704.php on lines 1..36
api/src/Migrations/Version20200325162657.php on lines 1..36
api/src/Migrations/Version20200506115046.php on lines 1..36
api/src/Migrations/Version20200506142524.php on lines 1..36
api/src/Migrations/Version20200709134600.php on lines 1..36
api/src/Migrations/Version20210625084030.php on lines 1..36
api/src/Migrations/Version20230118150956.php on lines 1..36

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

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

<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
Severity: Major
Found in api/src/Migrations/Version20200506142524.php and 11 other locations - About 4 hrs to fix
api/src/Migrations/Version20180921094924.php on lines 1..57
api/src/Migrations/Version20190514153722.php on lines 1..36
api/src/Migrations/Version20190527073022.php on lines 1..36
api/src/Migrations/Version20191127171355.php on lines 1..36
api/src/Migrations/Version20200320074704.php on lines 1..36
api/src/Migrations/Version20200325162657.php on lines 1..36
api/src/Migrations/Version20200506115046.php on lines 1..36
api/src/Migrations/Version20200515095252.php on lines 1..36
api/src/Migrations/Version20200709134600.php on lines 1..36
api/src/Migrations/Version20210625084030.php on lines 1..36
api/src/Migrations/Version20230118150956.php on lines 1..36

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

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 12 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/Version20180921094924.php and 11 other locations - About 4 hrs to fix
api/src/Migrations/Version20190514153722.php on lines 1..36
api/src/Migrations/Version20190527073022.php on lines 1..36
api/src/Migrations/Version20191127171355.php on lines 1..36
api/src/Migrations/Version20200320074704.php on lines 1..36
api/src/Migrations/Version20200325162657.php on lines 1..36
api/src/Migrations/Version20200506115046.php on lines 1..36
api/src/Migrations/Version20200506142524.php on lines 1..36
api/src/Migrations/Version20200515095252.php on lines 1..36
api/src/Migrations/Version20200709134600.php on lines 1..36
api/src/Migrations/Version20210625084030.php on lines 1..36
api/src/Migrations/Version20230118150956.php on lines 1..36

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

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

<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
Severity: Major
Found in api/src/Migrations/Version20190514153722.php and 11 other locations - About 4 hrs to fix
api/src/Migrations/Version20180921094924.php on lines 1..57
api/src/Migrations/Version20190527073022.php on lines 1..36
api/src/Migrations/Version20191127171355.php on lines 1..36
api/src/Migrations/Version20200320074704.php on lines 1..36
api/src/Migrations/Version20200325162657.php on lines 1..36
api/src/Migrations/Version20200506115046.php on lines 1..36
api/src/Migrations/Version20200506142524.php on lines 1..36
api/src/Migrations/Version20200515095252.php on lines 1..36
api/src/Migrations/Version20200709134600.php on lines 1..36
api/src/Migrations/Version20210625084030.php on lines 1..36
api/src/Migrations/Version20230118150956.php on lines 1..36

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

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

<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
Severity: Major
Found in api/src/Migrations/Version20190527073022.php and 11 other locations - About 4 hrs to fix
api/src/Migrations/Version20180921094924.php on lines 1..57
api/src/Migrations/Version20190514153722.php on lines 1..36
api/src/Migrations/Version20191127171355.php on lines 1..36
api/src/Migrations/Version20200320074704.php on lines 1..36
api/src/Migrations/Version20200325162657.php on lines 1..36
api/src/Migrations/Version20200506115046.php on lines 1..36
api/src/Migrations/Version20200506142524.php on lines 1..36
api/src/Migrations/Version20200515095252.php on lines 1..36
api/src/Migrations/Version20200709134600.php on lines 1..36
api/src/Migrations/Version20210625084030.php on lines 1..36
api/src/Migrations/Version20230118150956.php on lines 1..36

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

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

<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
Severity: Major
Found in api/src/Migrations/Version20210625084030.php and 11 other locations - About 4 hrs to fix
api/src/Migrations/Version20180921094924.php on lines 1..57
api/src/Migrations/Version20190514153722.php on lines 1..36
api/src/Migrations/Version20190527073022.php on lines 1..36
api/src/Migrations/Version20191127171355.php on lines 1..36
api/src/Migrations/Version20200320074704.php on lines 1..36
api/src/Migrations/Version20200325162657.php on lines 1..36
api/src/Migrations/Version20200506115046.php on lines 1..36
api/src/Migrations/Version20200506142524.php on lines 1..36
api/src/Migrations/Version20200515095252.php on lines 1..36
api/src/Migrations/Version20200709134600.php on lines 1..36
api/src/Migrations/Version20230118150956.php on lines 1..36

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

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

<?php declare(strict_types=1);

namespace DoctrineMigrations;

use Doctrine\DBAL\Schema\Schema;
Severity: Major
Found in api/src/Migrations/Version20200325162657.php and 11 other locations - About 4 hrs to fix
api/src/Migrations/Version20180921094924.php on lines 1..57
api/src/Migrations/Version20190514153722.php on lines 1..36
api/src/Migrations/Version20190527073022.php on lines 1..36
api/src/Migrations/Version20191127171355.php on lines 1..36
api/src/Migrations/Version20200320074704.php on lines 1..36
api/src/Migrations/Version20200506115046.php on lines 1..36
api/src/Migrations/Version20200506142524.php on lines 1..36
api/src/Migrations/Version20200515095252.php on lines 1..36
api/src/Migrations/Version20200709134600.php on lines 1..36
api/src/Migrations/Version20210625084030.php on lines 1..36
api/src/Migrations/Version20230118150956.php on lines 1..36

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

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

    private function deserializeMessage(array $data): ?Message
    {
        $message = new Message();
        $message = $this->autoSet($message, $data);
        if (isset($data['@id'])) {
Severity: Major
Found in client/src/MobicoopBundle/Api/Service/Deserializer.php and 1 other location - About 4 hrs to fix
client/src/MobicoopBundle/Api/Service/Deserializer.php on lines 511..531

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

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

    private function deserializeProposal(array $data): ?Proposal
    {
        $proposal = new Proposal();
        $proposal = $this->autoSet($proposal, $data);
        if (isset($data['@id'])) {
Severity: Major
Found in client/src/MobicoopBundle/Api/Service/Deserializer.php and 1 other location - About 4 hrs to fix
client/src/MobicoopBundle/Api/Service/Deserializer.php on lines 945..965

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

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

            foreach ($matching['offer']->getWaypoints() as $waypoint) {
                if (2 == $waypoint->getRole() && $waypoint->getPosition() > $destinations['requester']) {
                    $destinations['requester'] = $waypoint->getPosition();
                }
                if (2 == $waypoint->getRole() && $waypoint->getPosition() < $origins['requester']) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 4 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1175..1188

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

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

            foreach ($matching['request']->getWaypoints() as $waypoint) {
                if (1 == $waypoint->getRole() && $waypoint->getPosition() > $destinations['requester']) {
                    $destinations['requester'] = $waypoint->getPosition();
                }
                if (1 == $waypoint->getRole() && $waypoint->getPosition() < $origins['requester']) {
Severity: Major
Found in api/src/Carpool/Service/ResultManager.php and 1 other location - About 4 hrs to fix
api/src/Carpool/Service/ResultManager.php on lines 1749..1762

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

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

ProposalManager has 36 functions (exceeds 20 allowed). Consider refactoring.
Open

class ProposalManager
{
    public const ROLE_DRIVER = 1;
    public const ROLE_PASSENGER = 2;
    public const ROLE_BOTH = 3;
Severity: Minor
Found in api/src/Carpool/Service/ProposalManager.php - About 4 hrs to fix

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

    <?php
    
    /**
     * Copyright (c) 2021, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
    Severity: Major
    Found in api/src/Gamification/Repository/SequenceItemRepository.php and 4 other locations - About 4 hrs to fix
    api/src/Action/Repository/LogRepository.php on lines 1..65
    api/src/Gamification/Repository/BadgeRepository.php on lines 1..68
    api/src/Gamification/Repository/GamificationActionRepository.php on lines 1..68
    api/src/Solidary/Repository/SolidarySolutionRepository.php on lines 1..70

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

    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 5 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/Action/Repository/LogRepository.php and 4 other locations - About 4 hrs to fix
    api/src/Gamification/Repository/BadgeRepository.php on lines 1..68
    api/src/Gamification/Repository/GamificationActionRepository.php on lines 1..68
    api/src/Gamification/Repository/SequenceItemRepository.php on lines 1..68
    api/src/Solidary/Repository/SolidarySolutionRepository.php on lines 1..70

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

    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

            foreach ($solidary->getProofs() as $givenProof) {
                // We get the structure proof and we create a proof to persist
                $structureProofId = null;
                if (strrpos($givenProof['id'], '/')) {
                    $structureProofId = substr($givenProof['id'], strrpos($givenProof['id'], '/') + 1);
    Severity: Major
    Found in api/src/Solidary/Service/SolidaryManager.php and 2 other locations - About 4 hrs to fix
    api/src/Solidary/Service/SolidaryUserManager.php on lines 627..641
    api/src/Solidary/Service/SolidaryUserManager.php on lines 824..838

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

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

    <?php
    
    /**
     * Copyright (c) 2021, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
    Severity: Major
    Found in api/src/Gamification/Repository/BadgeRepository.php and 4 other locations - About 4 hrs to fix
    api/src/Action/Repository/LogRepository.php on lines 1..65
    api/src/Gamification/Repository/GamificationActionRepository.php on lines 1..68
    api/src/Gamification/Repository/SequenceItemRepository.php on lines 1..68
    api/src/Solidary/Repository/SolidarySolutionRepository.php on lines 1..70

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

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

    <?php
    
    /**
     * Copyright (c) 2021, MOBICOOP. All rights reserved.
     * This project is dual licensed under AGPL and proprietary licence.
    api/src/Action/Repository/LogRepository.php on lines 1..65
    api/src/Gamification/Repository/BadgeRepository.php on lines 1..68
    api/src/Gamification/Repository/SequenceItemRepository.php on lines 1..68
    api/src/Solidary/Repository/SolidarySolutionRepository.php on lines 1..70

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

    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 5 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/Repository/SolidarySolutionRepository.php and 4 other locations - About 4 hrs to fix
    api/src/Action/Repository/LogRepository.php on lines 1..65
    api/src/Gamification/Repository/BadgeRepository.php on lines 1..68
    api/src/Gamification/Repository/GamificationActionRepository.php on lines 1..68
    api/src/Gamification/Repository/SequenceItemRepository.php on lines 1..68

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

    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

                foreach ($solidaryVolunteer->getProofs() as $givenProof) {
                    // We get the structure proof and we create a proof to persist
                    $structureProofId = null;
                    if (strrpos($givenProof['id'], '/')) {
                        $structureProofId = substr($givenProof['id'], strrpos($givenProof['id'], '/') + 1);
    Severity: Major
    Found in api/src/Solidary/Service/SolidaryUserManager.php and 2 other locations - About 4 hrs to fix
    api/src/Solidary/Service/SolidaryManager.php on lines 1067..1081
    api/src/Solidary/Service/SolidaryUserManager.php on lines 627..641

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

    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