Test Setup Failed
Pull Request — master (#29)
by
unknown
04:19 queued 32s
created

Version20201230100058   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 66.67 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 18
loc 27
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A getDescription() 0 4 1
A up() 9 9 1
A down() 9 9 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
3
declare(strict_types=1);
4
5
namespace DoctrineMigrations;
6
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\Migrations\AbstractMigration;
9
10
/**
11
 * Auto-generated Migration: Please modify to your needs!
12
 */
13
final class Version20201230100058 extends AbstractMigration
14
{
15
    public function getDescription() : string
16
    {
17
        return '';
18
    }
19
20 View Code Duplication
    public function up(Schema $schema) : void
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
21
    {
22
        // this up() migration is auto-generated, please modify it to your needs
23
        $this->addSql('ALTER TABLE users CHANGE roles roles LONGTEXT NOT NULL COMMENT \'(DC2Type:json)\'');
24
        $this->addSql('DROP INDEX uniq_8d93d649f85e0677 ON users');
25
        $this->addSql('CREATE UNIQUE INDEX UNIQ_1483A5E9F85E0677 ON users (username)');
26
        $this->addSql('DROP INDEX uniq_8d93d649e7927c74 ON users');
27
        $this->addSql('CREATE UNIQUE INDEX UNIQ_1483A5E9E7927C74 ON users (email)');
28
    }
29
30 View Code Duplication
    public function down(Schema $schema) : void
0 ignored issues
show
Duplication introduced by
This method seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
31
    {
32
        // this down() migration is auto-generated, please modify it to your needs
33
        $this->addSql('ALTER TABLE users CHANGE roles roles LONGTEXT CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_bin`');
34
        $this->addSql('DROP INDEX uniq_1483a5e9f85e0677 ON users');
35
        $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649F85E0677 ON users (username)');
36
        $this->addSql('DROP INDEX uniq_1483a5e9e7927c74 ON users');
37
        $this->addSql('CREATE UNIQUE INDEX UNIQ_8D93D649E7927C74 ON users (email)');
38
    }
39
}
40