Showing 1,612 of 1,620 total issues
Similar blocks of code found in 2 locations. Consider refactoring. Open
if ($nblegs == (count($data['sections']) - 1)) {
if (isset($section['to'])) {
$arrival = new PTArrival(1); // we have to set an id as it's mandatory when using a custom data provider (see https://api-platform.com/docs/core/data-providers)
if ($data['arrival_date_time']) {
$arrival->setDate(new \DateTime($data['arrival_date_time']));
- Read upRead up
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 125.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
if (0 == $nblegs) {
if (isset($section['from'])) {
$departure = new PTDeparture(1); // we have to set an id as it's mandatory when using a custom data provider (see https://api-platform.com/docs/core/data-providers)
if ($data['departure_date_time']) {
$departure->setDate(new \DateTime($data['departure_date_time']));
- Read upRead up
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 125.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Recipient
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Recipient
{
const STATUS_PENDING = 1;
const STATUS_READ = 2;
SolidaryAsksListItem
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class SolidaryAsksListItem
{
const DRIVER_TYPE_VOLUNTEER = 0;
const DRIVER_TYPE_CARPOOLER = 1;
SolidaryResultCarpool
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class SolidaryResultCarpool
{
const DEFAULT_ID = 999999999999;
/**
ProofManager
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class ProofManager
{
private $entityManager;
private $logger;
private $provider;
SolidaryManager
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class SolidaryManager
{
/**
* @var User
*/
ClassicProof
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class ClassicProof
{
public const DEFAULT_ID = 999999999999;
/**
Delivery
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Delivery
{
public const STATUS_PENDING = 0;
public const STATUS_SENT = 1;
public const STATUS_ERROR = 2;
EecProvider
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
abstract class EecProvider implements EecProviderInterface
{
/**
* @var null|string
*/
Diary
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Diary
{
/**
* @var int the id of this diary action
*
Territory
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Territory implements ResourceInterface, \JsonSerializable
{
/**
* @var int
*/
User
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class User
{
public const DEFAULT_ID = 999999999999;
/**
CommunityManager
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class CommunityManager
{
use HydraControllerTrait;
private $dataProvider;
CarpoolExport
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class CarpoolExport
{
public const DEFAULT_ID = 999999999999;
public const ROLE_DRIVER = 1;
PTLine
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class PTLine
{
/**
* @var int The id of this line.
*
PublicProfile
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class PublicProfile
{
const SMOKE_NO = 0;
const SMOKE_NOT_IN_CAR = 1;
const SMOKE = 2;
Similar blocks of code found in 35 locations. Consider refactoring. Open
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
- Read upRead up
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 124.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 35 locations. Consider refactoring. Open
<?php declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
- Read upRead up
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 124.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 35 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.
- Read upRead up
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 124.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76