Completed
Push — 1.10.x ( 2635b5...f0080b )
by Yannick
165:55 queued 120:08
created

Version20151119082400   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 22
loc 22
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 3

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
/* For licensing terms, see /license.txt */
3
4
namespace Application\Migrations\Schema\V110;
5
6
use Application\Migrations\AbstractMigrationChamilo;
7
use Doctrine\DBAL\Schema\Schema;
8
use Doctrine\DBAL\Types\Type;
9
10
/**
11
 * Add new indexes
12
 */
13
class Version20151119082400 extends AbstractMigrationChamilo
14
{
15
    /**
16
     * @param Schema $schema
17
     */
18
    public function up(Schema $schema)
19
    {
20
        $user = $schema->getTable('user');
21
        $user->addIndex(['user_id']);
22
23
        $userRelTag = $schema->getTable('user_rel_tag');
24
        $userRelTag->addIndex(['user_id']);
25
        $userRelTag->addIndex(['tag_id']);
26
    }
27
28
    /**
29
     * @param Schema $schema
30
     */
31
    public function down(Schema $schema)
32
    {
33
    }
34
}
35