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    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/Entity/Chronos/ChronosJobEntity.php (1 issue)

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
 * @package: chapi
4
 *
5
 * @author:  msiebeneicher
6
 * @since:   2015-07-29
7
 *
8
 */
9
10
namespace Chapi\Entity\Chronos;
11
12
use Chapi\Entity\Chronos\JobEntity\ContainerEntity;
13
use Chapi\Entity\Chronos\JobEntity\FetchEntity;
14
use Chapi\Entity\JobEntityInterface;
15
16
class ChronosJobEntity implements JobEntityInterface
17
{
18
    public $name = '';
19
20
    public $command = '';
21
22
    public $description = '';
23
24
    public $owner = '';
25
26
    public $ownerName = '';
27
28
    public $schedule = ''; // todo: move to separate entity
29
30
    public $scheduleTimeZone = '';
31
32
    public $parents = []; // todo: move to separate entity
33
34
    public $epsilon = '';
35
36
    public $executor = '';
37
38
    public $executorFlags = '';
39
40
    public $shell = true;
41
42
    public $retries = 0;
43
44
    public $async = false;
45
46
    public $successCount = 0;
47
48
    public $errorCount = 0;
49
50
    public $errorsSinceLastSuccess = 0;
51
52
    public $lastSuccess = '';
53
54
    public $lastError = '';
55
56
    public $cpus = 0.1;
57
58
    public $disk = 24;
59
60
    public $mem = 32;
61
62
    public $disabled = false;
63
64
    public $softError = false;
65
66
    public $dataProcessingJobType = false;
67
68
    /** @var FetchEntity[] */
69
    public $fetch = [];
70
71
    public $environmentVariables = [];
72
73
    public $arguments = [];
74
75
    public $highPriority = false;
76
77
    public $runAsUser = 'root';
78
79
    public $constraints = [];
80
81
    /** @var ContainerEntity */
82
    public $container = null;
83
84
85
    /**
86
     * @param array|object $jobData
87
     * @throws \InvalidArgumentException
88
     */
89 117
    public function __construct($jobData = [])
90
    {
91 117
        if (is_array($jobData) || is_object($jobData)) {
92 116
            foreach ($jobData as $key => $value) {
93 18
                if (property_exists($this, $key)) {
94 18
                    if ($key == 'container') {
95 2
                        $this->{$key} = new ContainerEntity($value);
96 18
                    } else if ($key == 'fetch') {
97 6
                        foreach ($value as $fetch) {
98 6
                            $this->{$key}[] = new FetchEntity($fetch);
99
                        }
100
                    } else {
101 18
                        $this->{$key} = $value;
102
                    }
103 116
                } else {
0 ignored issues
show
This else statement is empty and can be removed.

This check looks for the else branches of if statements that have no statements or where all statements have been commented out. This may be the result of changes for debugging or the code may simply be obsolete.

These else branches can be removed.

if (rand(1, 6) > 3) {
print "Check failed";
} else {
    //print "Check succeeded";
}

could be turned into

if (rand(1, 6) > 3) {
    print "Check failed";
}

This is much more concise to read.

Loading history...
104
                    /* We are ignoring fields that are unknown to us. This is bad and can lead to unexpected differences
105
                     * when comparing the *.json on disk with the job definition from the Chronos API.
106
                     */
107
                }
108
            }
109
        } else {
110 1
            throw new \InvalidArgumentException(sprintf('Argument 1 passed to "%s" must be an array or object', __METHOD__));
111
        }
112 115
    }
113
114
    /**
115
     * return entity as one-dimensional array
116
     *
117
     * @return mixed[]
118
     */
119 8
    public function getSimpleArrayCopy()
120
    {
121 8
        $return = [];
122
123 8
        foreach ($this as $property => $value) {
124 8
            $return[$property] = (is_array($value) || is_object($value)) ? json_encode($value) : $value;
125
        }
126
127 8
        return $return;
128
    }
129
130
    /**
131
     * @return bool
132
     */
133 18
    public function isSchedulingJob()
134
    {
135 18
        return (!empty($this->schedule) && empty($this->parents));
136
    }
137
138
    /**
139
     * @return bool
140
     */
141 7
    public function isDependencyJob()
142
    {
143 7
        return (empty($this->schedule) && !empty($this->parents));
144
    }
145
146
    /**
147
     * @return array
148
     */
149 11
    public function jsonSerialize()
150
    {
151 11
        $return = (array) $this;
152 11
        if (!empty($this->schedule)) {
153 10
            unset($return['parents']);
154
        } else {
155 1
            unset($return['schedule']);
156 1
            unset($return['scheduleTimeZone']);
157
        }
158
159 11
        if (empty($this->container)) {
160 11
            unset($return['container']);
161
        } else {
162
            $return['container'] = (array) $this->container;
163
164
            $return['container']['volumes'] = [];
165
            foreach ($this->container->volumes as $volume) {
166
                $return['container']['volumes'][] = (array) $volume;
167
            }
168
        }
169
170 11
        $return['fetch'] = [];
171 11
        foreach ($this->fetch as $fetch) {
172
            $return['fetch'][] = (array) $fetch;
173
        }
174
175 11
        unset($return['successCount']);
176 11
        unset($return['errorCount']);
177 11
        unset($return['errorsSinceLastSuccess']);
178 11
        unset($return['lastSuccess']);
179 11
        unset($return['lastError']);
180
181 11
        return $return;
182
    }
183
184
    /**
185
     * @return \ArrayIterator
186
     */
187 9
    public function getIterator()
188
    {
189 9
        return new \ArrayIterator($this);
190
    }
191
192
    /**
193
     * @return string
194
     */
195 5
    public function getEntityType()
196
    {
197 5
        return JobEntityInterface::CHRONOS_TYPE;
198
    }
199
200
    /**
201
     * @return string
202
     */
203 41
    public function getKey()
204
    {
205 41
        return $this->name;
206
    }
207
}
208