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/Cli.php (3 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
 * Pimf
4
 *
5
 * @copyright Copyright (c)  Gjero Krsteski (http://krsteski.de)
6
 * @license   http://opensource.org/licenses/MIT MIT License
7
 */
8
9
namespace Pimf;
10
11
use Pimf\Util\Character as Str;
12
13
/**
14
 * A full featured package for managing command-line options and arguments,
15
 * it allows the developer to easily build complex command line interfaces.
16
 *
17
 * @package Pimf
18
 * @author  Gjero Krsteski <[email protected]>
19
 */
20
final class Cli
21
{
22
    /**
23
     * Prints out a list of CLI commands from the system,
24
     * which is defined at the controllers with the "CliAction()" suffix at the method-name.
25
     *
26
     * @param string $appClr  Path to application controller repository
27
     * @param string $coreClr Path to core controller repository
28
     * @param string $root    Path to home directory
29
     */
30
    public static function absorb($appClr = null, $coreClr = null, $root = null)
31
    {
32
        echo PHP_EOL . 'PIMF v' . \Pimf\Application::VERSION . ' PHP Command Line Interface by Gjero Krsteski' . PHP_EOL;
33
34
        echo '+------------------------------------------------------+' . PHP_EOL;
35
36
        self::reflect(self::collect($appClr, $coreClr, $root));
37
    }
38
39
    /**
40
     * @param array $classes
41
     */
42
    public static function reflect(array $classes)
43
    {
44
        array_map(
45
            function ($class) {
46
47
                $reflection = new \ReflectionClass($class);
48
49
                if ($reflection->isSubclassOf('\Pimf\Controller\Base')) {
50
51
                    $methods = $reflection->getMethods();
52
                    $controller = explode('_', $class);
53
54
                    echo 'controller: ' . strtolower(end($controller)) . '' . PHP_EOL;
55
56
                    array_map(
57
                        function (\ReflectionMethod $method) {
58
                            if (false !== $command = strstr($method->name, 'CliAction', true)) {
59
                                echo PHP_EOL . ' action: ' . $command . ' ' . PHP_EOL;
60
                            }
61
                        }, $methods
62
                    );
63
64
                    echo PHP_EOL . '+------------------------------------------------------+' . PHP_EOL;
65
                }
66
67
            }, $classes
68
        );
69
    }
70
71
    /**
72
     * @param string $appClr
73
     * @param string $coreClr
74
     * @param string $root
75
     *
76
     * @return array
77
     */
78
    public static function collect($appClr = null, $coreClr = null, $root = null)
79
    {
80
        $classes = array();
81
82
        if (!$root && !$coreClr && !$appClr) {
0 ignored issues
show
Bug Best Practice introduced by
The expression $root of type string|null is loosely compared to false; this is ambiguous if the string can be empty. You might want to explicitly use === null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For string values, the empty string '' is a special case, in particular the following results might be unexpected:

''   == false // true
''   == null  // true
'ab' == false // false
'ab' == null  // false

// It is often better to use strict comparison
'' === false // false
'' === null  // false
Loading history...
Bug Best Practice introduced by
The expression $coreClr of type string|null is loosely compared to false; this is ambiguous if the string can be empty. You might want to explicitly use === null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For string values, the empty string '' is a special case, in particular the following results might be unexpected:

''   == false // true
''   == null  // true
'ab' == false // false
'ab' == null  // false

// It is often better to use strict comparison
'' === false // false
'' === null  // false
Loading history...
Bug Best Practice introduced by
The expression $appClr of type string|null is loosely compared to false; this is ambiguous if the string can be empty. You might want to explicitly use === null instead.

In PHP, under loose comparison (like ==, or !=, or switch conditions), values of different types might be equal.

For string values, the empty string '' is a special case, in particular the following results might be unexpected:

''   == false // true
''   == null  // true
'ab' == false // false
'ab' == null  // false

// It is often better to use strict comparison
'' === false // false
'' === null  // false
Loading history...
83
            $coreClr = str_replace('/', DS, BASE_PATH . '/pimf-framework/core/Pimf/Controller/');
84
            $appClr = str_replace('/', DS, BASE_PATH . '/app/' . Config::get('app.name') . '/Controller/');
85
        }
86
87
        foreach (array($appClr, $coreClr) as $dir) {
88
89
            $iterator
90
                = new \RegexIterator(new \RecursiveIteratorIterator(new \RecursiveDirectoryIterator($dir)),
91
                '/^.+\.php$/i',
92
                \RecursiveRegexIterator::GET_MATCH);
93
94
            foreach (iterator_to_array($iterator, false) as $file) {
95
                $file = str_replace("\\", '/', current($file));
96
                $file = str_replace('/', DS, $file);
97
                $name = str_replace(
98
                    array(BASE_PATH . DS . 'pimf-framework' . DS . 'core' . DS, BASE_PATH . DS . 'app' . DS), '', $file
99
                );
100
101
                $name = str_replace(DS, '\\', $name);
102
                $name = str_replace('.php', '', $name);
103
                $classes[] = '\\' . $name;
104
            }
105
        }
106
107
        return $classes;
108
    }
109
110
    /**
111
     * @param array $commands
112
     *
113
     * @return array
114
     */
115
    public static function parse(array $commands)
116
    {
117
        $cli = array();
118
119
        parse_str(implode('&', array_slice($commands, 1)), $cli);
120
121
        $command = current(array_keys((array)$cli, ''));
122
123
        if (Str::contains($command, ':')) {
124
125
            list($controller, $action) = explode(':', $command);
126
127
            $cli['controller'] = $controller;
128
            $cli['action'] = $action;
129
        }
130
131
        return $cli;
132
    }
133
}
134