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.

FilterTestName   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 38
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A draw() 12 12 1
A registerListeners() 22 22 2

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
namespace Spatie\PhpUnitWatcher\Screens;
4
5 View Code Duplication
class FilterTestName extends Screen
0 ignored issues
show
Duplication introduced by
This class 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...
6
{
7
    public function draw()
8
    {
9
        $this->terminal
10
            ->comment('Pattern mode usage')
11
            ->write('Type a pattern and press Enter to apply pattern to all tests.')
12
            ->write('Press Enter with an empty pattern to keep the current pattern.')
13
            ->emptyLine()
14
            ->comment('Start typing to filter by a test name.')
15
            ->prompt('pattern > ');
16
17
        return $this;
18
    }
19
20
    public function registerListeners()
21
    {
22
        $this->terminal->on('data', function ($line) {
23
            if ($line == '') {
24
                $this->terminal->goBack();
25
26
                return;
27
            }
28
29
            $phpunitArguments = "--filter={$line}";
30
31
            $phpunitScreen = $this->terminal->getPreviousScreen();
32
33
            $options = $phpunitScreen->options;
0 ignored issues
show
Bug introduced by
The property options does not seem to exist in Spatie\PhpUnitWatcher\Screens\Screen.

An attempt at access to an undefined property has been detected. This may either be a typographical error or the property has been renamed but there are still references to its old name.

If you really want to allow access to undefined properties, you can define magic methods to allow access. See the php core documentation on Overloading.

Loading history...
34
35
            $options['phpunit']['arguments'] = $phpunitArguments;
36
37
            $this->terminal->displayScreen(new Phpunit($options));
38
        });
39
40
        return $this;
41
    }
42
}
43