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 (57)

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.

Integration/Procedure/ProcedureCompilerTest.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
/*
4
 * This file is part of the php-phantomjs.
5
 *
6
 * For the full copyright and license information, please view the LICENSE
7
 * file that was distributed with this source code.
8
 */
9
namespace JonnyW\PhantomJs\Tests\Integration\Procedure;
10
11
use JonnyW\PhantomJs\Http\Request;
12
use JonnyW\PhantomJs\Procedure\ProcedureCompiler;
13
use JonnyW\PhantomJs\DependencyInjection\ServiceContainer;
14
15
/**
16
 * PHP PhantomJs
17
 *
18
 * @author Jon Wenmoth <[email protected]>
19
 */
20
class ProcedureCompilerTest extends \PHPUnit_Framework_TestCase
21
{
22
23
/** +++++++++++++++++++++++++++++++++++ **/
24
/** ++++++++++++++ TESTS ++++++++++++++ **/
25
/** +++++++++++++++++++++++++++++++++++ **/
26
27
    /**
28
     * Test can compile procedure
29
     *
30
     * @access public
31
     * @return void
32
     */
33
    public function testCanCompileProcedure()
34
    {
35
        $procedure = $this->getProcedure('http_default');
36
37
        $uncompiled = $procedure->getTemplate();
38
39
        $request = $this->getRequest();
40
        $request->setUrl('http://test.com');
41
42
        $compiler = $this->getProcedureCompiler();
43
        $compiler->compile($procedure, $request);
44
45
        $this->assertNotSame($uncompiled, $procedure->getTemplate());
46
    }
47
48
    /**
49
     * Test procedure is loaded from cache
50
     * if cache is enabled.
51
     *
52
     * @access public
53
     * @return void
54
     */
55
    public function testProcedureIsLoadedFromCacheIfCacheIsEnabled()
56
    {
57
        $procedure1 = $this->getProcedure('http_default');
58
        $procedure2 = $this->getProcedure('http_default');
59
60
        $request = $this->getRequest();
61
        $request->setUrl('http://test.com');
62
63
        $renderer = $this->getMock('\JonnyW\PhantomJs\Template\TemplateRendererInterface');
64
        $renderer->expects($this->exactly(1))
65
            ->method('render')
66
            ->will($this->returnValue('var test=1; phantom.exit(1);'));
67
68
        $serviceContainer = ServiceContainer::getInstance();
69
70
        $compiler = new ProcedureCompiler(
71
            $serviceContainer->get('phantomjs.procedure.chain_loader'),
72
            $serviceContainer->get('phantomjs.procedure.procedure_validator'),
73
            $serviceContainer->get('phantomjs.cache.file_cache'),
74
            $renderer
75
        );
76
77
        $compiler->enableCache();
78
        $compiler->compile($procedure1, $request);
79
        $compiler->compile($procedure2, $request);
80
    }
81
82
    /**
83
     * Test procedure is not loaded from
84
     * cache if cache is disabled.
85
     *
86
     * @access public
87
     * @return void
88
     */
89
    public function testProcedureIsNotLoadedFromCacheIfCacheIsDisabled()
90
    {
91
        $procedure1 = $this->getProcedure('http_default');
92
        $procedure2 = $this->getProcedure('http_default');
93
94
        $request = $this->getRequest();
95
        $request->setUrl('http://test.com');
96
97
        $renderer = $this->getMock('\JonnyW\PhantomJs\Template\TemplateRendererInterface');
98
        $renderer->expects($this->exactly(2))
99
            ->method('render')
100
            ->will($this->returnValue('var test=1; phantom.exit(1);'));
101
102
        $serviceContainer = ServiceContainer::getInstance();
103
104
        $compiler = new ProcedureCompiler(
105
            $serviceContainer->get('phantomjs.procedure.chain_loader'),
106
            $serviceContainer->get('phantomjs.procedure.procedure_validator'),
107
            $serviceContainer->get('phantomjs.cache.file_cache'),
108
            $renderer
109
        );
110
111
        $compiler->disableCache();
112
        $compiler->compile($procedure1, $request);
113
        $compiler->compile($procedure2, $request);
114
    }
115
116
    /**
117
     * Test procedure cache can be cleared.
118
     *
119
     * @access public
120
     * @return void
121
     */
122
    public function testProcedureCacheCanBeCleared()
123
    {
124
        $procedure1 = $this->getProcedure('http_default');
125
        $procedure2 = $this->getProcedure('http_default');
126
127
        $request = $this->getRequest();
128
        $request->setUrl('http://test.com');
129
130
        $renderer = $this->getMock('\JonnyW\PhantomJs\Template\TemplateRendererInterface');
131
        $renderer->expects($this->exactly(2))
132
            ->method('render')
133
            ->will($this->returnValue('var test=1; phantom.exit(1);'));
134
135
        $serviceContainer = ServiceContainer::getInstance();
136
137
        $compiler = new ProcedureCompiler(
138
            $serviceContainer->get('phantomjs.procedure.chain_loader'),
139
            $serviceContainer->get('phantomjs.procedure.procedure_validator'),
140
            $serviceContainer->get('phantomjs.cache.file_cache'),
141
            $renderer
142
        );
143
144
        $compiler->compile($procedure1, $request);
145
        $compiler->clearCache();
146
        $compiler->compile($procedure2, $request);
147
    }
148
149
    /**
150
     * Test syntax exception is thrown if compiled
151
     * template is not valid.
152
     *
153
     * @access public
154
     * @return void
155
     */
156
    public function testSyntaxExceptionIsThrownIfCompiledTemplateIsNotValid()
157
    {
158
        $this->setExpectedException('\JonnyW\PhantomJs\Exception\SyntaxException');
159
160
        $template = <<<EOF
161
    console.log(;
162
EOF;
163
        $procedure = $this->getProcedure('http_default');
164
        $procedure->setTemplate($template);
165
166
        $request = $this->getRequest();
167
        $request->setUrl('http://test.com');
168
169
        $compiler = $this->getProcedureCompiler();
170
        $compiler->compile($procedure, $request);
171
172
    }
173
174
/** +++++++++++++++++++++++++++++++++++ **/
175
/** ++++++++++ TEST ENTITIES ++++++++++ **/
176
/** +++++++++++++++++++++++++++++++++++ **/
177
178
    /**
179
     * Get procedure compiler.
180
     *
181
     * @access protected
182
     * @return \JonnyW\PhantomJs\Procedure\ProcedureCompiler
183
     */
184
    protected function getProcedureCompiler()
185
    {
186
        $serviceContainer = ServiceContainer::getInstance();
187
188
        $compiler = new ProcedureCompiler(
189
            $serviceContainer->get('phantomjs.procedure.chain_loader'),
190
            $serviceContainer->get('phantomjs.procedure.procedure_validator'),
191
            $serviceContainer->get('phantomjs.cache.file_cache'),
192
            $serviceContainer->get('phantomjs.procedure.template_renderer')
193
        );
194
195
        return $compiler;
196
    }
197
198
    /**
199
     * getProcedure function.
200
     *
201
     * @access protected
202
     * @param  string                                         $id
203
     * @return \JonnyW\PhantomJs\Procedure\ProcedureInterface
204
     */
205
    protected function getProcedure($id)
206
    {
207
        return ServiceContainer::getInstance()->get('procedure_loader')->load($id);
208
    }
209
210
    /**
211
     * Get request
212
     *
213
     * @access protected
214
     * @return \JonnyW\PhantomJs\Http\Request
215
     */
216
    protected function getRequest()
217
    {
218
        $request = new Request();
219
220
        return $request;
221
    }
222
223
/** +++++++++++++++++++++++++++++++ **/
224
/** ++++++++++ UTILITIES ++++++++++ **/
225
/** +++++++++++++++++++++++++++++++ **/
226
227
    /**
228
     * Set up tasks.
229
     *
230
     * @access protected
231
     * @return void
232
     */
233
    protected function setUp()
234
    {
235
        parent::setUp();
236
237
        $this->cleanup();
238
    }
239
240
    /**
241
     * Tear down tasks.
242
     *
243
     * @access protected
244
     * @return void
245
     */
246
    protected function tearDown()
247
    {
248
        parent::setUp();
0 ignored issues
show
Comprehensibility Bug introduced by
It seems like you call parent on a different method (setUp() instead of tearDown()). Are you sure this is correct? If so, you might want to change this to $this->setUp().

This check looks for a call to a parent method whose name is different than the method from which it is called.

Consider the following code:

class Daddy
{
    protected function getFirstName()
    {
        return "Eidur";
    }

    protected function getSurName()
    {
        return "Gudjohnsen";
    }
}

class Son
{
    public function getFirstName()
    {
        return parent::getSurname();
    }
}

The getFirstName() method in the Son calls the wrong method in the parent class.

Loading history...
249
250
        $this->cleanup();
251
    }
252
253
    /**
254
     * Clean up cache files.
255
     *
256
     * @access protected
257
     * @return void
258
     */
259
    protected function cleanup()
260
    {
261
        $cache = sprintf('%s/phantomjs_*', sys_get_temp_dir());
262
263
        array_map('unlink', glob($cache));
264
    }
265
}
266