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

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/File/Handler.php (4 issues)

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
 * Nip Framework
5
 *
6
 * @category   Nip
7
 * @copyright  2009 Nip Framework
8
 * @license    http://www.opensource.org/licenses/mit-license.php The MIT License
9
 * @version    SVN: $Id: Handler.php 70 2009-04-29 11:47:12Z victor.stanciu $
10
 */
11
class Nip_File_Handler
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
12
{
13
    const MODE_READ = "r";
14
    const MODE_WRITE = "w";
15
    const MODE_APPEND = "a";
16
17
18
    /**
19
     * @var string
20
     */
21
    public $name;
22
23
    /**
24
     * @var null|string
25
     */
26
    public $path = null;
27
28
    /**
29
     * @var null|string
30
     */
31
    public $url = null;
32
33
    public $data;
34
    public $extension;
35
    public $permissions = 0777;
36
    protected $handle = null;
37
38
    /**
39
     * Nip_File_Handler constructor.
40
     * @param bool $data
41
     */
42
    public function __construct($data = false)
43
    {
44
        if ($data) {
45
            foreach ($data as $key => $value) {
0 ignored issues
show
The expression $data of type boolean is not traversable.
Loading history...
46
                $this->{$key} = $value;
47
            }
48
        }
49
    }
50
51
    /**
52
     * @param $name
53
     * @param $arguments
54
     * @return $this
55
     */
56
    public function __call($name, $arguments)
57
    {
58
        if (substr($name, 0, 3) == 'set') {
59
            $name = str_replace("set", "", $name);
60
            $name{0} = strtolower($name{0});
61
62
            $this->$name = $arguments[0];
63
            return $this;
64
        } else {
65
            trigger_error("Method [$name] not defined", E_USER_ERROR);
66
        }
67
    }
68
69
    /**
70
     * @param $upload
71
     */
72
    public function upload($upload)
73
    {
74
        move_uploaded_file($upload["tmp_name"], $this->path);
75
    }
76
77
    /**
78
     * @return $this
79
     */
80
    public function delete()
81
    {
82
        return Nip_File_System::instance()->deleteFile($this->path);
83
    }
84
85
    /**
86
     * @return $this|false
87
     */
88
    public function gzip()
89
    {
90
        if (function_exists("gzencode")) {
91
            $this->data = gzencode($this->data, 9, FORCE_GZIP);
92
        } else {
93
            return false;
94
        }
95
        return $this;
96
    }
97
98
    /**
99
     * @param bool $data
100
     * @param string $mode
101
     */
102
    public function write($data = false, $mode = self::MODE_APPEND)
103
    {
104
        if ($data) {
105
            $this->setData($data);
0 ignored issues
show
Documentation Bug introduced by
The method setData does not exist on object<Nip_File_Handler>? Since you implemented __call, maybe consider adding a @method annotation.

If you implement __call and you know which methods are available, you can improve IDE auto-completion and static analysis by adding a @method annotation to the class.

This is often the case, when __call is implemented by a parent class and only the child class knows which methods exist:

class ParentClass {
    private $data = array();

    public function __call($method, array $args) {
        if (0 === strpos($method, 'get')) {
            return $this->data[strtolower(substr($method, 3))];
        }

        throw new \LogicException(sprintf('Unsupported method: %s', $method));
    }
}

/**
 * If this class knows which fields exist, you can specify the methods here:
 *
 * @method string getName()
 */
class SomeClass extends ParentClass { }
Loading history...
106
        }
107
108
        $this->open($mode);
109
        fwrite($this->handle, $this->data);
110
        $this->close($mode);
0 ignored issues
show
The call to Nip_File_Handler::close() has too many arguments starting with $mode.

This check compares calls to functions or methods with their respective definitions. If the call has more arguments than are defined, it raises an issue.

If a function is defined several times with a different number of parameters, the check may pick up the wrong definition and report false positives. One codebase where this has been known to happen is Wordpress.

In this case you can add the @ignore PhpDoc annotation to the duplicate definition and it will be ignored.

Loading history...
111
112
        chmod($this->path, $this->permissions);
113
    }
114
115
    /**
116
     * @param bool $data
117
     */
118
    public function rewrite($data = false)
119
    {
120
        return $this->write($data, self::MODE_WRITE);
121
    }
122
123
    /**
124
     * @param string $mode
125
     * @return $this
126
     */
127
    public function open($mode = self::MODE_READ)
128
    {
129
        $this->handle = fopen($this->path, $mode);
130
        return $this;
131
    }
132
133
    /**
134
     * @return $this
135
     */
136
    public function close()
137
    {
138
        if ($this->handle) {
139
            fclose($this->handle);
140
            $this->handle = null;
141
        } else {
142
            trigger_error("Attempting to close an unopened file", E_USER_WARNING);
143
        }
144
145
        return $this;
146
    }
147
148
149
    /**
150
     * @return null|string
151
     */
152
    public function getUrl()
153
    {
154
        if ($this->url === null) {
155
            $this->initUrl();
156
        }
157
        return $this->url;
158
    }
159
160
161
    public function initUrl()
162
    {
163
        $this->url = '';
164
    }
165
166
    /**
167
     * @return null|string
168
     */
169
    public function getPath()
170
    {
171
        if ($this->path === null) {
172
            $this->initPath();
173
        }
174
        return $this->path;
175
    }
176
177
    public function initPath()
178
    {
179
        $this->path = '';
180
    }
181
182
}