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

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.

core/Pimf/View.php (2 issues)

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
/**
3
 * Pimf
4
 *
5
 * @copyright Copyright (c)  Gjero Krsteski (http://krsteski.de)
6
 * @license   http://opensource.org/licenses/MIT MIT
7
 */
8
9
namespace Pimf;
10
11
use Pimf\Contracts\Renderable;
12
use Pimf\Util\File;
13
use Pimf\Contracts\Arrayable;
14
15
/**
16
 * A simply view for sending and rendering data.
17
 *
18
 * @package Pimf
19
 * @author  Gjero Krsteski <[email protected]>
20
 */
21
class View implements Renderable
22
{
23
    /**
24
     * @var string Name of the template.
25
     */
26
    protected $template;
27
28
    /**
29
     * Contains the variables that are to be embedded in the template.
30
     *
31
     * @var \ArrayObject
32
     */
33
    protected $data;
34
35
    /**
36
     * Path to templates - is framework restriction.
37
     *
38
     * @var string
39
     */
40
    protected $path;
41
42
    /**
43
     * @param string $template
44
     * @param array  $data
45
     * @param string $path Path to templates if you do not want to use PIMF framework restriction.
46
     */
47
    public function __construct($template = 'default.phtml', array $data = array(), $path = null)
48
    {
49
        $this->data = new \ArrayObject($data, \ArrayObject::ARRAY_AS_PROPS);
50
        $this->path = (!$path) ? BASE_PATH . 'app/' . Config::get('app.name') . '/_templates' : $path;
51
        $this->template = (string)$template;
52
    }
53
54
    /**
55
     * @param string $template
56
     *
57
     * @return View
58
     */
59
    public function produce($template)
60
    {
61
        $view = clone $this;
62
        $view->template = (string)$template;
63
64
        return $view;
65
    }
66
67
    /**
68
     * @param string          $template
69
     * @param array|Arrayable $model
70
     *
71
     * @return string
72
     */
73
    public function partial($template, $model = array())
74
    {
75
        $model = ($model instanceof Arrayable) ? $model->toArray() : $model;
76
77
        return $this->produce($template)->pump($model)->render();
78
    }
79
80
    /**
81
     * @param string $template
82
     * @param array  $model
83
     *
84
     * @return string
85
     */
86
    public function loop($template, array $model = array())
87
    {
88
        $out = '';
89
90
        foreach ($model as $row) {
91
            $out .= $this->partial($template, $row);
92
        }
93
94
        return $out;
95
    }
96
97
    /**
98
     * Assigns a variable to a specific key for the template.
99
     *
100
     * @param string $key   The key.
101
     * @param mixed  $value The Value.
102
     *
103
     * @return View
104
     */
105
    public function assign($key, $value)
106
    {
107
        $this->data[$key] = $value;
108
109
        return $this;
110
    }
111
112
    /**
113
     * Exchange all variables.
114
     *
115
     * @param $model
116
     *
117
     * @return View
118
     */
119
    public function pump($model)
120
    {
121
        $this->data->exchangeArray((array)$model);
122
123
        return $this;
124
    }
125
126
    /**
127
     * @param string $name
128
     *
129
     * @return mixed
130
     * @throws \OutOfBoundsException If undefined property at the template.
131
     */
132
    public function __get($name)
133
    {
134
        if ($this->data->offsetExists($name)) {
135
            return $this->data->offsetGet($name);
136
        }
137
138
        $trace = debug_backtrace();
139
        throw new \OutOfBoundsException(
140
            'undefined property "' . $name . '" at file ' . $trace[0]['file'] . ' line ' . $trace[0]['line']
141
        );
142
    }
143
144
    /**
145
     * @return string
146
     */
147
    public function render()
148
    {
149
        $level = ob_get_level();
0 ignored issues
show
$level is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
150
        ob_start();
151
152
        try {
153
154
            echo $this->reunite();
155
156
        } catch (\Exception $exception) {
0 ignored issues
show
catch (\Exception $excep...ge(), E_USER_NOTICE); } does not seem to be reachable.

This check looks for unreachable code. It uses sophisticated control flow analysis techniques to find statements which will never be executed.

Unreachable code is most often the result of return, die or exit statements that have been added for debug purposes.

function fx() {
    try {
        doSomething();
        return true;
    }
    catch (\Exception $e) {
        return false;
    }

    return false;
}

In the above example, the last return false will never be executed, because a return statement has already been met in every possible execution path.

Loading history...
157
158
            while (ob_get_level() > $level) {
159
                ob_end_clean();
160
            }
161
162
            trigger_error($exception->getMessage(), E_USER_NOTICE);
163
        }
164
165
        return ob_get_clean();
166
    }
167
168
    /**
169
     * Puts the template an the variables together.
170
     */
171
    public function reunite()
172
    {
173
        include new File(str_replace('/', DS, $this->path . '/' . $this->template));
174
    }
175
176
    /**
177
     * Act when the view is treated like a string
178
     *
179
     * @return string
180
     */
181
    public function __toString()
182
    {
183
        return $this->render();
184
    }
185
}
186