Issues (100)

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.

lib/Php/Structure/PHPClass.php (1 issue)

Labels
Severity

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
namespace Goetas\Xsd\XsdToPhp\Php\Structure;
3
4
class PHPClass
5
{
6
7
    protected $name;
8
9
    protected $namespace;
10
11
    protected $doc;
12
13 16
    public static function createFromFQCN($className)
14
    {
15 16
        if (($pos = strrpos($className, '\\')) !== false) {
16
            return new self(substr($className, $pos + 1), substr($className, 0, $pos));
17
        } else {
18 16
            return new self($className);
19
        }
20
    }
21
22 33
    public function __construct($name = null, $namespace = null)
23
    {
24 33
        $this->name = $name;
25 33
        $this->namespace = $namespace;
26 33
    }
27
28 26
    public function getName()
29
    {
30 26
        return $this->name;
31
    }
32
33 30
    public function setName($name)
34
    {
35 30
        $this->name = $name;
36 30
        return $this;
37
    }
38
39 27
    public function getNamespace()
40
    {
41 27
        return $this->namespace;
42
    }
43
44 30
    public function setNamespace($namespace)
45
    {
46 30
        $this->namespace = $namespace;
47 30
        return $this;
48
    }
49
50 8
    public function getDoc()
51
    {
52 8
        return $this->doc;
53
    }
54
55 30
    public function setDoc($doc)
56
    {
57 30
        $this->doc = $doc;
58 30
        return $this;
59
    }
60
61 1
    public function __toString()
62
    {
63 1
        return $this->getFullName();
64
    }
65
66 31
    public function getFullName()
67
    {
68 31
        return "{$this->namespace}\\{$this->name}";
69
    }
70
71
    protected $checks = array();
72
73
    /**
74
     *
75
     * @var PHPConstant[]
76
     */
77
    protected $constants = array();
78
79
    /**
80
     *
81
     * @var PHPProperty[]
82
     */
83
    protected $properties = array();
84
85
    /**
86
     *
87
     * @param
88
     *            $property
89
     * @return array
90
     */
91
    public function getChecks($property)
92
    {
93
        return isset($this->checks[$property]) ? $this->checks[$property] : array();
94
    }
95
96
    /**
97
     *
98
     * @param
99
     *            $property
100
     * @param
101
     *            $check
102
     * @param
103
     *            $value
104
     * @return $this
105
     */
106 1
    public function addCheck($property, $check, $value)
107
    {
108 1
        $this->checks[$property][$check][] = $value;
109 1
        return $this;
110
    }
111
112
    /**
113
     *
114
     * @return PHPProperty[]
115
     */
116 19
    public function getProperties()
117
    {
118 19
        return $this->properties;
119
    }
120
121
    /**
122
     *
123
     * @param string $name
124
     * @return boolean
125
     */
126 8
    public function hasProperty($name)
127
    {
128 8
        return isset($this->properties[$name]);
129
    }
130
131
    /**
132
     *
133
     * @param string $name
134
     * @return bool
135
     */
136 8
    public function hasPropertyInHierarchy($name)
137
    {
138 8
        if ($this->hasProperty($name)) {
139 2
            return true;
140
        }
141 7
        if (($this instanceof PHPClass) && $this->getExtends() && $this->getExtends()->hasPropertyInHierarchy($name)) {
142
            return true;
143
        }
144 7
        return false;
145
    }
146
147
    /**
148
     *
149
     * @param string $name
150
     * @return PHPProperty
151
     */
152 2
    public function getPropertyInHierarchy($name)
153
    {
154 2
        if ($this->hasProperty($name)) {
155 2
            return $this->getProperty($name);
156
        }
157
        if (($this instanceof PHPClass) && $this->getExtends() && $this->getExtends()->hasPropertyInHierarchy($name)) {
158
            return $this->getExtends()->getPropertyInHierarchy($name);
159
        }
160
        return null;
161
    }
162
163
    /**
164
     *
165
     * @param string $name
0 ignored issues
show
There is no parameter named $name. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
166
     * @return PHPProperty
167
     */
168 2
    public function getPropertiesInHierarchy()
169
    {
170 2
        $ps = $this->getProperties();
171
172 2
        if (($this instanceof PHPClass) && $this->getExtends()) {
173
            $ps = array_merge($ps, $this->getExtends()->getPropertiesInHierarchy());
174
        }
175
176 2
        return $ps;
177
    }
178
179
    /**
180
     *
181
     * @param string $name
182
     * @return PHPProperty
183
     */
184 8
    public function getProperty($name)
185
    {
186 8
        return $this->properties[$name];
187
    }
188
189
    /**
190
     *
191
     * @param PHPProperty $property
192
     * @return $this
193
     */
194 30
    public function addProperty(PHPProperty $property)
195
    {
196 30
        $this->properties[$property->getName()] = $property;
197 30
        return $this;
198
    }
199
200
    /**
201
     *
202
     * @var boolean
203
     */
204
    protected $abstract;
205
206
    /**
207
     *
208
     * @var PHPClass
209
     */
210
    protected $extends;
211
212
    /**
213
     *
214
     * @return PHPClass
215
     */
216 19
    public function getExtends()
217
    {
218 19
        return $this->extends;
219
    }
220
221
    /**
222
     *
223
     * @param PHPClass $extends
224
     * @return PHPClass
225
     */
226 17
    public function setExtends(PHPClass $extends)
227
    {
228 17
        $this->extends = $extends;
229 17
        return $this;
230
    }
231
232
    public function getAbstract()
233
    {
234
        return $this->abstract;
235
    }
236
237 25
    public function setAbstract($abstract)
238
    {
239 25
        $this->abstract = (boolean)$abstract;
240 25
        return $this;
241
    }
242
}
243