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/Helpers/Url.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
use Nip\Dispatcher\Dispatcher;
3
4
/**
5
 * Class Nip_Helper_Url
6
 */
7
class Nip_Helper_Url extends Nip\Helpers\AbstractHelper
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...
8
{
9
    use \Nip\Router\RouterAwareTrait;
10
11
    protected $pieces = [];
12
13
    /**
14
     * Singleton
15
     * @return Nip_Helper_URL
16
     */
17
    static public function instance()
0 ignored issues
show
As per PSR2, the static declaration should come after the visibility declaration.
Loading history...
18
    {
19
        static $instance;
20
        if (!($instance instanceof self)) {
21
            $instance = new self();
22
        }
23
24
        return $instance;
25
    }
26
27
    /**
28
     * @param $name
29
     * @param $arguments
30
     * @return $this|mixed
31
     */
32
    public function __call($name, $arguments)
33
    {
34
        if ($name == ucfirst($name)) {
35
            $this->pieces[] = Dispatcher::reverseControllerName($name);
36
            return $this;
37
        } else {
38
            $this->pieces[] = $name;
39
        }
40
41
        $name = $this->pieces ? implode(".", $this->pieces) : '';
42
        $this->pieces = [];
43
        return $this->assemble($name, isset($arguments[0]) ? $arguments[0] : null);
44
    }
45
46
    /**
47
     * @param $name
48
     * @param bool $params
49
     * @return mixed
50
     */
51
    public function assemble($name, $params = false)
52
    {
53
        return $this->getRouter()->assembleFull($name, $params);
0 ignored issues
show
$params is of type boolean, but the function expects a array.

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...
54
    }
55
56
    /**
57
     * @param $name
58
     * @param bool $params
59
     * @return mixed
60
     */
61
    public function get($name, $params = false)
62
    {
63
        return $this->assemble($name, $params);
64
    }
65
66
    /**
67
     * @param $name
68
     * @param bool $params
69
     * @return mixed|string
70
     */
71
    public function route($name, $params = false)
72
    {
73
        return $this->getRouter()->assemble($name, $params);
0 ignored issues
show
$params is of type boolean, but the function expects a array.

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...
74
    }
75
76
    /**
77
     * @param array $params
78
     * @return string
79
     */
80
    public function base($params = [])
81
    {
82
        $currentRoute = $this->getRouter()->getCurrent();
83
        $base = $currentRoute ? $currentRoute->getBase($params) : request()->root();
84
85
        return $base.($params ? "?".http_build_query($params) : '');
86
    }
87
88
    /**
89
     * Reverse of the PHP built-in function parse_url
90
     *
91
     * @see http://php.net/parse_url
92
     * @param array $params
93
     * @return string
94
     */
95
    public function build($params)
96
    {
97
        return ((isset($params['scheme'])) ? $params['scheme'] . '://' : '')
98
        . ((isset($params['user'])) ? $params['user'] . ((isset($params['pass'])) ? ':' . $params['pass'] : '') . '@' : '')
99
        . ((isset($params['host'])) ? $params['host'] : '')
100
        . ((isset($params['port'])) ? ':' . $params['port'] : '')
101
        . ((isset($params['path'])) ? $params['path'] : '')
102
        . ((isset($params['query'])) ? '?' . $params['query'] : '')
103
        . ((isset($params['fragment'])) ? '#' . $params['fragment'] : '');
104
    }
105
106
    /**
107
     * Replaces all non-alphanumeric characters and returns dash-separated string
108
     *
109
     * @param string $input
110
     * @return string
111
     */
112
    public function encode($input)
113
    {
114
        $chars = [
115
            '&#x102;' => 'a',
116
            '&#x103;' => 'a',
117
            '&#xC2;' => 'A',
118
            '&#xE2;' => 'a',
119
            '&#xCE;' => 'I',
120
            '&#xEE;' => 'i',
121
            '&#x218;' => 'S',
122
            '&#x219;' => 's',
123
            '&#x15E;' => 'S',
124
            '&#x15F;' => 's',
125
            '&#x21A;' => 'T',
126
            '&#x21B;' => 't',
127
            '&#354;' => 'T',
128
            '&#355;' => 't'
129
        ];
130
131
        $change = $with = [];
132
        foreach ($chars as $i => $v) {
133
            $change[] = html_entity_decode($i, ENT_QUOTES, 'UTF-8');
134
            $with[] = $v;
135
        }
136
        $input = str_replace($change, $with, $input);
137
138
        preg_match_all("/[a-z0-9]+/i", $input, $sections);
139
        return strtolower(implode("-", $sections[0]));
140
    }
141
142
    public function getRequest()
143
    {
144
    }
145
}
146