Issues (569)

Security Analysis    not enabled

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/Task/Testing/Atoum.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 Robo\Task\Testing;
4
5
use Robo\Contract\CommandInterface;
6
use Robo\Contract\PrintedInterface;
7
use Robo\Task\BaseTask;
8
9
/**
10
 * Runs [atoum](http://atoum.org/) tests
11
 *
12
 * ``` php
13
 * <?php
14
 * $this->taskAtoum()
15
 *  ->files('path/to/test.php')
16
 *  ->configFile('config/dev.php')
17
 *  ->run()
18
 *
19
 * ?>
20
 * ```
21
 */
22
class Atoum extends BaseTask implements CommandInterface, PrintedInterface
23
{
24
    use \Robo\Common\ExecOneCommand;
25
26
    /**
27
     * @var string
28
     */
29
    protected $command;
30
31
    /**
32
     * Atoum constructor.
33
     *
34
     * @param null|string $pathToAtoum
35
     *
36
     * @throws \Robo\Exception\TaskException
37
     */
38 View Code Duplication
    public function __construct($pathToAtoum = null)
0 ignored issues
show
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...
39
    {
40
        $this->command = $pathToAtoum;
41
        if (!$this->command) {
42
            $this->command = $this->findExecutable('atoum');
43
        }
44
        if (!$this->command) {
45
            throw new \Robo\Exception\TaskException(__CLASS__, "Neither local atoum nor global composer installation not found");
46
        }
47
    }
48
49
    /**
50
     * Tag or Tags to filter.
51
     *
52
     * @param string|string[] $tags
53
     *
54
     * @return $this
55
     */
56
    public function tags($tags)
57
    {
58
        return $this->addMultipleOption('tags', $tags);
59
    }
60
61
    /**
62
     * Display result using the light reporter.
63
     *
64
     * @return $this
65
     */
66
    public function lightReport()
67
    {
68
        $this->option("--use-light-report");
69
70
        return $this;
71
    }
72
73
    /**
74
     * Display result using the tap reporter.
75
     *
76
     * @return $this
77
     */
78
    public function tap()
79
    {
80
        $this->option("use-tap-report");
81
82
        return $this;
83
    }
84
85
    /**
86
     * Path to the bootstrap file.
87
88
     * @param string $file
89
     *
90
     * @return $this
91
     */
92
    public function bootstrap($file)
93
    {
94
        $this->option("bootstrap", $file);
95
96
        return $this;
97
    }
98
99
    /**
100
     * Path to the config file.
101
     *
102
     * @param string $file
103
     *
104
     * @return $this
105
     */
106
    public function configFile($file)
107
    {
108
        $this->option('-c', $file);
109
110
        return $this;
111
    }
112
113
    /**
114
     * Use atoum's debug mode.
115
     *
116
     * @return $this
117
     */
118
    public function debug()
119
    {
120
        $this->option("debug");
121
122
        return $this;
123
    }
124
125
    /**
126
     * Test file or test files to run.
127
     *
128
     * @param string|string[]
129
     *
130
     * @return $this
131
     */
132
    public function files($files)
133
    {
134
        return $this->addMultipleOption('f', $files);
135
    }
136
137
    /**
138
     * Test directory or directories to run.
139
     *
140
     * @param string|string[]
141
     *   A single directory or a list of directories.
142
     *
143
     * @return $this
144
     */
145
    public function directories($directories)
146
    {
147
        return $this->addMultipleOption('directories', $directories);
148
    }
149
150
    /**
151
     * @param string $option
152
     * @param string|string[] $values
153
     *
154
     * @return $this
155
     */
156
    protected function addMultipleOption($option, $values)
157
    {
158
        if (is_string($values)) {
159
            $values = [$values];
160
        }
161
162
        foreach ($values as $value) {
163
            $this->option($option, $value);
164
        }
165
166
        return $this;
167
    }
168
169
    /**
170
     * {@inheritdoc}
171
     */
172
    public function getCommand()
173
    {
174
        return $this->command . $this->arguments;
175
    }
176
177
    /**
178
     * {@inheritdoc}
179
     */
180
    public function run()
181
    {
182
        $this->printTaskInfo('Running atoum ' . $this->arguments);
183
184
        return $this->executeCommand($this->getCommand());
185
    }
186
}
187