Completed
Pull Request — master (#77)
by Michal
01:23
created

NoRateLimit   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 10
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 10
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A check() 0 7 1
1
<?php
2
3
namespace Tomaj\NetteApi\RateLimit;
4
5
use Nette\Application\Responses\TextResponse;
6
7
class NoRateLimit implements RateLimitInterface
8
{
9
    public function check(): ?RateLimitResponse
10
    {
11
12
        return new RateLimitResponse(40, 0, 123, new TextResponse('blablabla'));
13
14
        return null;
0 ignored issues
show
Unused Code introduced by
return null; does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
15
    }
16
}
17