GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.

CronTaskRepository::getOneTask()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 12
Code Lines 10

Duplication

Lines 12
Ratio 100 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 12
loc 12
rs 9.4286
cc 1
eloc 10
nc 1
nop 0
1
<?php
2
3
namespace TMSolution\CronBundle\Repository;
4
5
use Doctrine\ORM\EntityRepository;
6
7
/**
8
 * PaymentRepository
9
 *
10
 * This class was generated by the Doctrine ORM. Add your own custom
11
 * repository methods below.
12
 */
13
class CronTaskRepository extends EntityRepository
14
{
15
16 View Code Duplication
    public function getOneTask()
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...
17
    {
18
        return $this->createQueryBuilder('ct')
19
                        ->where('ct.firstRun <= :currentDate')
20
                        ->andWhere('ct.disabled = 0')
21
                        ->andWhere('ct.used = 0')
22
                        ->setParameter('currentDate', new \DateTime('now'), \Doctrine\DBAL\Types\Type::DATETIME)
23
                        ->orderBy('ct.firstRun')
24
                        ->setMaxResults(1)
25
                        ->getQuery()
26
                        ->getOneOrNullResult();
27
    }
28
    
29 View Code Duplication
    public function getNewTasks($maxResult=10)
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...
30
    {
31
        return $this->createQueryBuilder('ct')
32
                        ->where('ct.firstRun <= :currentDate')
33
                        ->andWhere('ct.disabled = 0')
34
                        ->andWhere('ct.used = 0')
35
                        ->setParameter('currentDate', new \DateTime('now'), \Doctrine\DBAL\Types\Type::DATETIME)
36
                        ->orderBy('ct.firstRun')
37
                        ->setMaxResults($maxResult)
38
                        ->getQuery()
39
                        ->getResult();
40
    }
41
42
}
43