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

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.

src/Task/IterateTask.php (2 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
 * See class comment
4
 *
5
 * PHP Version 5
6
 *
7
 * @category   Netresearch
8
 * @package    Netresearch\Kite
9
 * @subpackage Task
10
 * @author     Christian Opitz <[email protected]>
11
 * @license    http://www.netresearch.de Netresearch Copyright
12
 * @link       http://www.netresearch.de
13
 */
14
15
namespace Netresearch\Kite\Task;
16
use Netresearch\Kite\Exception;
17
use Netresearch\Kite\Task;
18
19
/**
20
 * Run each task for each of an arrays element
21
 *
22
 * @category   Netresearch
23
 * @package    Netresearch\Kite
24
 * @subpackage Task
25
 * @author     Christian Opitz <[email protected]>
26
 * @license    http://www.netresearch.de Netresearch Copyright
27
 * @link       http://www.netresearch.de
28
 */
29
class IterateTask extends SubTask
30
{
31
    /**
32
     * @var string
33
     */
34
    protected $defaultAs = null;
35
36
    /**
37
     * @var string
38
     */
39
    protected $defaultKey = null;
40
41
    /**
42
     * @var array
43
     */
44
    private $array;
45
46
    /**
47
     * @var array
48
     */
49
    private $as;
50
51
    private $running = false;
52
53
    /**
54
     * Configure the options
55
     *
56
     * @return array
57
     */
58
    protected function configureVariables()
59
    {
60
        return array(
61
            'array' => array(
62
                'type' => 'array',
63
                'required' => true,
64
                'label' => 'The array to iterate over'
65
            ),
66
            'as' => array(
67
                'type' => 'string|array',
68
                'default' => $this->defaultAs,
69
                'label' => 'String with variable name to set the VALUEs to or array which\'s key to set the KEYs  and which\'s value to set the VALUEs to'
70
            ),
71
            'key' => array(
72
                'type' => 'string',
73
                'default' => $this->defaultKey,
74
                'label' => 'Variable name to set the KEYs to (ignored when "as" doesn\'t provide both'
75
            ),
76
            '--'
77
        ) + parent::configureVariables();
78
    }
79
80
    /**
81
     * Get the array to iterate over
82
     *
83
     * @return array
84
     */
85
    protected function getArray()
86
    {
87
        if ($this->array === null) {
88
            $this->array = $this->get('array');
0 ignored issues
show
Documentation Bug introduced by
It seems like $this->get('array') of type * is incompatible with the declared type array of property $array.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
89
            if (!is_array($this->array) && !$this->array instanceof \Traversable) {
90
                throw new Exception('Invalid array');
91
            }
92
        }
93
        return $this->array;
94
    }
95
96
    /**
97
     * Get the as (key => value) config
98
     *
99
     * @return array
100
     */
101
    protected function getAs()
102
    {
103
        if ($this->as === null) {
104
            $as = $this->get('as', $this->defaultAs);
105
            if (is_array($as)) {
106
                $key = key($as);
107
                $value = $as[$key];
108
            } else {
109
                $key = $this->get('key', $this->defaultKey);
110
                $value = $as;
111
            }
112
            $this->as = array();
113
            foreach (array('key', 'value') as $name) {
114
                if ($$name) {
115
                    if ($this->has($$name)) {
116
                        throw new Exception('Variable ' . $$name . ' is already present');
117
                    }
118
                    $this->as[$name] = $$name;
119
                }
120
            }
121
        }
122
        return $this->as;
123
    }
124
125
    /**
126
     * Run the task
127
     *
128
     * @param Task $task The task
129
     *
130
     * @return mixed|null The task return value or null when if failed or dry run
131
     */
132
    protected function runTask(Task $task)
133
    {
134
        if ($this->running) {
135
            return parent::runTask($task);
136
        }
137
138
        $this->running = true;
139
140
        $as = $this->getAs();
141
142
        foreach ($this->getArray() as $key => $value) {
143
            foreach ($as as $type => $name) {
144
                $this->set($name, $$type);
145
            }
146
            try {
147
                parent::runTask($task);
148
            } catch (\Exception $exception) {
149
                break;
150
            }
151
        }
152
153 View Code Duplication
        if (isset($exception) && $exception instanceof Exception\BreakException) {
0 ignored issues
show
This code seems to be duplicated across your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
154
            $message = $exception->getMessage();
155
            if ($message) {
156
                $this->console->output($task->expand($message));
157
            }
158
            unset($exception);
159
        }
160
161
        if (isset($key)) {
162
            foreach ($as as $name) {
163
                $this->remove($name);
164
            }
165
        }
166
167
        $this->running = false;
168
169
        if (isset($exception)) {
170
            throw $exception;
171
        }
172
    }
173
}
174
?>
175