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.

Issues (15)

Security Analysis    no request data  

This project does not seem to handle request data directly as such no vulnerable execution paths were found.

  Cross-Site Scripting
Cross-Site Scripting enables an attacker to inject code into the response of a web-request that is viewed by other users. It can for example be used to bypass access controls, or even to take over other users' accounts.
  File Exposure
File Exposure allows an attacker to gain access to local files that he should not be able to access. These files can for example include database credentials, or other configuration files.
  File Manipulation
File Manipulation enables an attacker to write custom data to files. This potentially leads to injection of arbitrary code on the server.
  Object Injection
Object Injection enables an attacker to inject an object into PHP code, and can lead to arbitrary code execution, file exposure, or file manipulation attacks.
  Code Injection
Code Injection enables an attacker to execute arbitrary code on the server.
  Response Splitting
Response Splitting can be used to send arbitrary responses.
  File Inclusion
File Inclusion enables an attacker to inject custom files into PHP's file loading mechanism, either explicitly passed to include, or for example via PHP's auto-loading mechanism.
  Command Injection
Command Injection enables an attacker to inject a shell command that is execute with the privileges of the web-server. This can be used to expose sensitive data, or gain access of your server.
  SQL Injection
SQL Injection enables an attacker to execute arbitrary SQL code on your database server gaining access to user data, or manipulating user data.
  XPath Injection
XPath Injection enables an attacker to modify the parts of XML document that are read. If that XML document is for example used for authentication, this can lead to further vulnerabilities similar to SQL Injection.
  LDAP Injection
LDAP Injection enables an attacker to inject LDAP statements potentially granting permission to run unauthorized queries, or modify content inside the LDAP tree.
  Header Injection
  Other Vulnerability
This category comprises other attack vectors such as manipulating the PHP runtime, loading custom extensions, freezing the runtime, or similar.
  Regex Injection
Regex Injection enables an attacker to execute arbitrary code in your PHP process.
  XML Injection
XML Injection enables an attacker to read files on your local filesystem including configuration files, or can be abused to freeze your web-server process.
  Variable Injection
Variable Injection enables an attacker to overwrite program variables with custom data, and can lead to further vulnerabilities.
Unfortunately, the security analysis is currently not available for your project. If you are a non-commercial open-source project, please contact support to gain access.

src/Screens/Phpunit.php (1 issue)

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
3
namespace Spatie\PhpUnitWatcher\Screens;
4
5
use Spatie\PhpUnitWatcher\Notification;
6
use Symfony\Component\Process\Process;
7
8
class Phpunit extends Screen
9
{
10
    const DEFAULT_BINARY_PATH = 'vendor/bin/phpunit';
11
12
    /** @var array */
13
    public $options;
14
15
    /** @var string */
16
    protected $phpunitArguments;
17
18
    /** @var string */
19
    private $phpunitBinaryPath;
20
21
    /** @var int */
22
    private $phpunitTimeout;
23
24
    public function __construct(array $options)
25
    {
26
        $this->options = $options;
27
28
        $this->phpunitArguments = $options['phpunit']['arguments'] ?? '';
29
        $this->phpunitBinaryPath = $options['phpunit']['binaryPath'] ?? self::DEFAULT_BINARY_PATH;
30
        $this->phpunitTimeout = $options['phpunit']['timeout'] ?? 60;
31
    }
32
33
    public function draw()
34
    {
35
        $this
36
            ->writeHeader()
37
            ->runTests()
38
            ->displayManual();
39
    }
40
41
    public function registerListeners()
42
    {
43
        $this->terminal->onKeyPress(function ($line) {
44
            $line = strtolower($line);
45
46
            switch ($line) {
47
                case '':
48
                    $this->terminal->refreshScreen();
49
                    break;
50
                case 'a':
51
                    $this->options['phpunit']['arguments'] = '';
52
53
                    $this->terminal->displayScreen(new self($this->options));
54
                    break;
55
                case 'g':
56
                    $this->terminal->displayScreen(new FilterGroupName());
57
                    break;
58
                case 's':
59
                    $this->terminal->displayScreen(new FilterTestSuiteName());
60
                    break;
61
                case 't':
62
                    $this->terminal->displayScreen(new FilterTestName());
63
                    break;
64
                case 'p':
65
                    $this->terminal->displayScreen(new FilterFileName());
66
                    break;
67
                case 'r':
68
                    $this->terminal->displayScreen(new RandomSeed());
69
                    break;
70
                case 'q':
71
                    die();
72
                    break;
0 ignored issues
show
break; 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...
73
                default:
74
                    $this->registerListeners();
75
                    break;
76
            }
77
        });
78
79
        return $this;
80
    }
81
82
    protected function writeHeader()
83
    {
84
        $title = 'Starting PHPUnit';
85
86
        if (! empty($this->phpunitArguments)) {
87
            $title .= " with arguments: `{$this->phpunitArguments}`";
88
        }
89
90
        $this->terminal
91
            ->comment($title)
92
            ->emptyLine();
93
94
        return $this;
95
    }
96
97
    protected function runTests()
98
    {
99
        $result = (new Process(array_merge([$this->phpunitBinaryPath], explode(' ', $this->phpunitArguments))))
100
            ->setTimeout($this->phpunitTimeout)
101
            ->setTty(Process::isTtySupported())
102
            ->run(function ($type, $line) {
103
                echo $line;
104
            });
105
106
        $this->sendDesktopNotification($result);
107
108
        return $this;
109
    }
110
111
    protected function displayManual()
112
    {
113
        if ($this->options['hideManual']) {
114
            return $this;
115
        }
116
117
        $this->terminal
118
            ->emptyLine()
119
            ->write('<dim>Press </dim>a<dim> to run all tests.</dim>')
120
            ->write('<dim>Press </dim>t<dim> to filter by test name.</dim>')
121
            ->write('<dim>Press </dim>p<dim> to filter by file name.</dim>')
122
            ->write('<dim>Press </dim>g<dim> to filter by group name.</dim>')
123
            ->write('<dim>Press </dim>s<dim> to filter by test suite name.</dim>')
124
            ->write('<dim>Press </dim>r<dim> to run tests with a random seed.</dim>')
125
            ->write('<dim>Press </dim>q<dim> to quit the watcher.</dim>')
126
            ->write('<dim>Press </dim>Enter<dim> to trigger a test run.</dim>');
127
128
        return $this;
129
    }
130
131
    protected function sendDesktopNotification(int $result)
132
    {
133
        $notificationName = $result === 0
134
            ? 'passingTests'
135
            : 'failingTests';
136
137
        if ($this->options['notifications'][$notificationName]) {
138
            Notification::create()->$notificationName();
139
        }
140
    }
141
}
142