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/RsyncTask.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
17
/**
18
 * RSync from/to the current node or all nodes if no current
19
 *
20
 * @category   Netresearch
21
 * @package    Netresearch\Kite
22
 * @subpackage Task
23
 * @author     Christian Opitz <[email protected]>
24
 * @license    http://www.netresearch.de Netresearch Copyright
25
 * @link       http://www.netresearch.de
26
 */
27
class RsyncTask extends \Netresearch\Kite\Task\ScpTask
28
{
29
    /**
30
     * @var array
31
     */
32
    protected $defaultOptions = array(
33
        'compress' => true,
34
        'rsh' => 'ssh{node.sshOptions}',
35
        'recursive' => true,
36
        'times' => true,
37
        // 'perms',
38
        'links' => true
39
        /* 'delete',
40
        'delete-excluded' */
41
    );
42
43
    /**
44
     * @var array
45
     */
46
    protected $defaultRules = array(
47
        'exclude' => array(
48
            '.*'
49
        ),
50
        'include' => array(
51
            '.htaccess'
52
        )
53
    );
54
55
    /**
56
     * @var
57
     */
58
    protected $options;
59
60
    /**
61
     * Configure the options
62
     *
63
     * @return array
64
     */
65 View Code Duplication
    protected function configureVariables()
0 ignored issues
show
This method seems to be duplicated in 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...
66
    {
67
        return array(
68
            'exclude' => array(
69
                'type' => 'array',
70
                'default' => array(),
71
                'label' => 'Array with files/dirs to explicitely exclude'
72
            ),
73
            'include' => array(
74
                'type' => 'array',
75
                'default' => array(),
76
                'label' => 'Array with files/dirs to explicitely include'
77
            ),
78
            'options' => array(
79
                'type' => 'array',
80
                'default' => array(),
81
                'label' => 'Array with options for rsync: Elements with numeric keys or bool true values will be --switches.'
82
            ),
83
            '--'
84
        ) + parent::configureVariables();
85
    }
86
87
    /**
88
     * Run the task
89
     *
90
     * @return array|mixed
91
     */
92
    public function run()
93
    {
94
        if ($this->console->getOutput()->isQuiet()) {
95
            $this->defaultOptions['quiet'] = true;
96
        }
97
        if ($this->console->getOutput()->isVeryVerbose()) {
98
            $this->defaultOptions['verbose'] = true;
99
        }
100
        $this->options = array_merge($this->defaultOptions, $this->get('options'));
101
102
        if (!$this->shouldExecute()) {
103
            $this->options['dry-run'] = true;
104
        }
105
106
        $this->preview();
107
        return $this->execute();
0 ignored issues
show
Bug Compatibility introduced by
The expression $this->execute(); of type null|string|array adds the type array to the return on line 107 which is incompatible with the return type of the parent method Netresearch\Kite\Task\ShellTask::run of type null|string.
Loading history...
108
    }
109
110
    /**
111
     * Get the rsync command
112
     *
113
     * @return string
114
     */
115
    protected function getScpCommand()
116
    {
117
        $rsyncCommand = 'rsync' . $this->renderOptions($this->options);
118
119
        foreach (array('include', 'exclude') as $type) {
120
            $rules = $this->getMergedArrayOption($type, $this->defaultRules[$type]);
121
            foreach ($rules as $rule) {
122
                $rsyncCommand .= ' --' . $type . '=' . escapeshellarg($rule);
123
            }
124
        }
125
126
        return $rsyncCommand;
127
    }
128
129
    /**
130
     * Merge an (optional) array option into defaults
131
     *
132
     * Given f.e. that the option has the following value:
133
     * array(
134
     *  'debug',
135
     *  'include' => '*',
136
     *  'quiet' => null,
137
     * )
138
     *
139
     * and the defaults are:
140
     * array(
141
     *  'compress',
142
     *  'quiet'
143
     * )
144
     *
145
     * the result would be:
146
     * array(
147
     *  'compress',
148
     *  'debug',
149
     *  'include' => '*'
150
     * )
151
     *
152
     * @param string $name     The name
153
     * @param array  $defaults The defaults
154
     *
155
     * @return array
156
     */
157
    protected function getMergedArrayOption($name, array $defaults)
158
    {
159
        $options = $defaults;
160
        foreach ($this->get($name) as $option => $value) {
161
            if (is_numeric($option)) {
162
                if (!in_array($value, $options)) {
163
                    $options[] = $value;
164
                }
165
            } else {
166
                if (!$value) {
167
                    if (array_key_exists($option, $options)) {
168
                        unset($options[$option]);
169
                    } else {
170
                        $i = array_search($option, $options);
171
                        if (is_numeric($i)) {
172
                            unset($options[$i]);
173
                        }
174
                    }
175
                } else {
176
                    $options[$option] = $value;
177
                }
178
            }
179
        }
180
        return $options;
181
    }
182
}
183
?>
184