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.

PhantomJs/Tests/Unit/Parser/JsonParserTest.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\Unit\Parser;
10
11
use JonnyW\PhantomJs\Parser\JsonParser;
12
13
/**
14
 * PHP PhantomJs
15
 *
16
 * @author Jon Wenmoth <[email protected]>
17
 */
18
class JsonParserTest extends \PHPUnit_Framework_TestCase
19
{
20
21
/*****************/
22
/***** TESTS *****/
23
/*****************/
24
25
    /**
26
     * Test parse returns array if data
27
     * is null.
28
     *
29
     * @access public
30
     * @return void
31
     */
32
    public function testParseReturnsArrayIfDataIsNull()
33
    {
34
        $data = null;
35
36
        $jsonParser = $this->getJsonParser();
37
38
        $this->assertInternalType('array', $jsonParser->parse($data));
39
    }
40
41
    /**
42
     * Test parse returns array if data
43
     * is not a string.
44
     *
45
     * @access public
46
     * @return void
47
     */
48
    public function testParseReturnsArrayIfDataIsNotAString()
49
    {
50
        $data = new \stdClass();
51
52
        $jsonParser = $this->getJsonParser();
53
54
        $this->assertInternalType('array', $jsonParser->parse($data));
0 ignored issues
show
$data is of type object<stdClass>, but the function expects a string.

It seems like the type of the argument is not accepted by the function/method which you are calling.

In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.

We suggest to add an explicit type cast like in the following example:

function acceptsInteger($int) { }

$x = '123'; // string "123"

// Instead of
acceptsInteger($x);

// we recommend to use
acceptsInteger((integer) $x);
Loading history...
55
    }
56
57
    /**
58
     * Test parse returns array if data
59
     * is invalid JSON format.
60
     *
61
     * @access public
62
     * @return void
63
     */
64
    public function testParseReturnsArrayIfDataIsInvalidJsonFormat()
65
    {
66
        $data = 'Invalid JSON format';
67
68
        $jsonParser = $this->getJsonParser();
69
70
        $this->assertInternalType('array', $jsonParser->parse($data));
71
    }
72
73
    /**
74
     * Test parse returns array if data
75
     * is broken json format.
76
     *
77
     * @access public
78
     * @return void
79
     */
80
    public function testParseReturnsArrayIfDataIsBrokenJsonFormat()
81
    {
82
        $data = '{data: Unquoted string}';
83
84
        $jsonParser = $this->getJsonParser();
85
86
        $this->assertInternalType('array', $jsonParser->parse($data));
87
    }
88
89
    /**
90
     * Test parse returns array if data
91
     * is valid JSON object.
92
     *
93
     * @access public
94
     * @return void
95
     */
96
    public function testParseReturnsArrayIfDataIsValidJsonObject()
97
    {
98
        $data = '{"data": "Test data"}';
99
100
        $jsonParser = $this->getJsonParser();
101
102
        $this->assertInternalType('array', $jsonParser->parse($data));
103
    }
104
105
    /**
106
     * Test parse returns array if data
107
     * is valid JSON array.
108
     *
109
     * @access public
110
     * @return void
111
     */
112
    public function testParseReturnsArrayIfDataIsValidJsonArray()
113
    {
114
        $data = '["Test data"]';
115
116
        $jsonParser = $this->getJsonParser();
117
118
        $this->assertInternalType('array', $jsonParser->parse($data));
119
    }
120
121
    /**
122
     * Test parse successfully parses data
123
     * if data is valid JSON object.
124
     *
125
     * @access public
126
     * @return void
127
     */
128
    public function testParseSuccessfullyParsesDataIfDataIsValidJsonObject()
129
    {
130
        $data = '{"data": "Test data"}';
131
132
        $jsonParser = $this->getJsonParser();
133
        $parsedData = $jsonParser->parse($data);
134
135
        $expectedData = array(
136
            'data' => 'Test data'
137
        );
138
139
        $this->assertSame($parsedData, $expectedData);
140
    }
141
142
    /**
143
     * Test parse successfully parses data
144
     * if data is valid JSON array.
145
     *
146
     * @access public
147
     * @return void
148
     */
149
    public function testParseSuccessfullyParsesDataIfDataIsValidJsonArray()
150
    {
151
        $data = '["Test data"]';
152
153
        $jsonParser = $this->getJsonParser();
154
        $parsedData = $jsonParser->parse($data);
155
156
        $expectedData = array(
157
            'Test data'
158
        );
159
160
        $this->assertSame($parsedData, $expectedData);
161
    }
162
163
    /**
164
     * Test parse successfully parses
165
     * multidimensional data if data is
166
     * valid JSON format.
167
     *
168
     * @access public
169
     * @return void
170
     */
171
    public function testParseSuccessfullyParsesMultidimensionalDataIfDataIsValidJsonFormat()
172
    {
173
         $data = '{
174
            "data": {
175
                "data": { "data": "Test data" },
176
                "more_data": "More test data"
177
            }
178
         }';
179
180
        $jsonParser = $this->getJsonParser();
181
        $parsedData = $jsonParser->parse($data);
182
183
        $expectedData = array(
184
            'data' => array(
185
                'data'      => array( 'data' => 'Test data' ),
186
                'more_data' => 'More test data'
187
            )
188
        );
189
190
        $this->assertSame($parsedData, $expectedData);
191
    }
192
193
/** +++++++++++++++++++++++++++++++++++ **/
194
/** ++++++++++ TEST ENTITIES ++++++++++ **/
195
/** +++++++++++++++++++++++++++++++++++ **/
196
197
    /**
198
     * Get JSON parser instance.
199
     *
200
     * @access protected
201
     * @return \JonnyW\PhantomJs\Parser\JsonParser
202
     */
203
    protected function getJsonParser()
204
    {
205
        $jsonParser = new JsonParser();
206
207
        return $jsonParser;
208
    }
209
}
210