Completed
Pull Request — master (#137)
by
unknown
15:56
created

CustomerRepository::findUsernameByApiKey()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 10
Code Lines 6

Duplication

Lines 10
Ratio 100 %

Importance

Changes 0
Metric Value
cc 1
eloc 6
nc 1
nop 1
dl 10
loc 10
rs 9.4285
c 0
b 0
f 0
1
<?php
2
3
namespace AppBundle\Repository;
4
5
/**
6
 * CustomerRepository
7
 *
8
 * This class was generated by the Doctrine ORM. Add your own custom
9
 * repository methods below.
10
 */
11
class CustomerRepository extends \Doctrine\ORM\EntityRepository
12
{
13
    public $apiKey;
14 View Code Duplication
    public function findUsernameByApiKey($apiKey){
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...
15
        $qb = $this->createQueryBuilder('u');
16
        $qb->select('u.username,u.id')
17
            // ->from('User', 'u')
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
18
            ->where('u.apiKey =:api')
19
            ->setParameter('api', $apiKey);
20
        //->getQuery()
21
        //->getResult();
22
        return $qb->getQuery()->getResult();
23
    }
24
    public $id;
25 View Code Duplication
    public function findUserByFacebookId($id){
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...
26
        $qb = $this->createQueryBuilder('u');
27
        $qb->select('u.id, u.username, u.facebookID')
28
            // ->from('User', 'u')
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
29
            ->where('u.facebookID =:name')
30
            ->setParameter('name', $id);
31
        //->getQuery()
32
        //->getResult();
33
        return $qb->getQuery()->getResult();
34
    }
35
}
36