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

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.

Ogone/Subscription/SubscriptionPaymentRequest.php (6 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
namespace Ogone\Subscription;
4
5
use InvalidArgumentException;
6
use DateTime;
7
use Ogone\Ecommerce\EcommercePaymentRequest;
8
9
class SubscriptionPaymentRequest extends EcommercePaymentRequest
10
{
11
12
    /**
13
     * Set amount in cents, eg EUR 12.34 is written as 1234
14
     * For subscriptions an amount of 0 can be selected, however this feature must first be enabled by ogone for your account
15
     */
16 6 View Code Duplication
    public function setAmount($amount)
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...
17
    {
18 6
        if (!is_int($amount)) {
19 1
            throw new InvalidArgumentException("Integer expected. Amount is always in cents");
20
        }
21 5
        if ($amount < 0) {
22 1
            throw new InvalidArgumentException("Amount must be a positive number or 0");
23
        }
24 4
        if ($amount >= 1.0E+15) {
25 1
            throw new InvalidArgumentException("Amount is too high");
26
        }
27
28 3
        $this->parameters['amount'] = $amount;
29
30 3
    }
31
32
    /**
33
     * Unique identifier of the subscription. The subscription id must be assigned dynamically.
34
     * @author RenĂ© de Kat <[email protected]>
35
     *
36
     * @param string $subscriptionId (maxlength 50)
37
     */
38 3 View Code Duplication
    public function setSubscriptionId($subscriptionId)
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...
39
    {
40 3
        if (strlen($subscriptionId) > 50) {
41 1
            throw new InvalidArgumentException("Subscription id cannot be longer than 50 characters");
42
        }
43 2
        if (preg_match('/[^a-zA-Z0-9_-]/', $subscriptionId)) {
44 1
            throw new InvalidArgumentException("Subscription id cannot contain special characters");
45
        }
46 1
        $this->parameters['subscription_id'] = $subscriptionId;
47 1
    }
48
49
    /**
50
     * Amount of the subscription (can be different from the amount of the original transaction)
51
     * multiplied by 100, since the format of the amount must not contain any decimals or other separators.
52
     *
53
     * @author RenĂ© de Kat <[email protected]>
54
     *
55
     * @param integer $amount
56
     */
57 5 View Code Duplication
    public function setSubscriptionAmount($amount)
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...
58
    {
59 5
        if (!is_int($amount)) {
60 1
            throw new InvalidArgumentException("Integer expected. Amount is always in cents");
61
        }
62 4
        if ($amount <= 0) {
63 2
            throw new InvalidArgumentException("Amount must be a positive number");
64
        }
65 2
        if ($amount >= 1.0E+15) {
66 1
            throw new InvalidArgumentException("Amount is too high");
67
        }
68 1
        $this->parameters['sub_amount'] = $amount;
69 1
    }
70
71
    /**
72
     * Order description
73
     * @author RenĂ© de Kat <[email protected]>
74
     *
75
     * @param string $description (maxlength 100)
76
     */
77 3 View Code Duplication
    public function setSubscriptionDescription($description)
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...
78
    {
79 3
        if (strlen($description) > 100) {
80 1
            throw new InvalidArgumentException("Subscription description cannot be longer than 100 characters");
81
        }
82 2
        if (preg_match('/[^a-zA-Z0-9_ -]/', $description)) {
83 1
            throw new InvalidArgumentException("Subscription description cannot contain special characters");
84
        }
85 1
        $this->parameters['sub_com'] = $description;
86 1
    }
87
88
    /**
89
     * OrderID for subscription payments
90
     * @author RenĂ© de Kat <[email protected]>
91
     *
92
     * @param string $orderId (maxlength 40)
93
     */
94 3 View Code Duplication
    public function setSubscriptionOrderId($orderId)
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...
95
    {
96 3
        if (strlen($orderId) > 40) {
97 1
            throw new InvalidArgumentException("Subscription order id cannot be longer than 40 characters");
98
        }
99 2
        if (preg_match('/[^a-zA-Z0-9_-]/', $orderId)) {
100 1
            throw new InvalidArgumentException("Subscription order id cannot contain special characters");
101
        }
102 1
        $this->parameters['sub_orderid'] = $orderId;
103 1
    }
104
105
    /**
106
     * Set subscription payment interval
107
     * @author RenĂ© de Kat <[email protected]>
108
     */
109 1
    public function setSubscriptionPeriod(SubscriptionPeriod $period)
110
    {
111 1
        $this->parameters['sub_period_unit'] = $period->getUnit();
112 1
        $this->parameters['sub_period_number'] = $period->getInterval();
113 1
        $this->parameters['sub_period_moment'] = $period->getMoment();
114 1
    }
115
116
117
    /**
118
     * Subscription start date
119
     * @author RenĂ© de Kat <[email protected]>
120
     *
121
     * @param DateTime $date    Startdate of the subscription.
122
     */
123 1
    public function setSubscriptionStartdate(DateTime $date)
124
    {
125 1
        $this->parameters['sub_startdate'] = $date->format('Y-m-d');
126 1
    }
127
128
    /**
129
     * Subscription end date
130
     * @author RenĂ© de Kat <[email protected]>
131
     *
132
     * @param DateTime $date    Enddate of the subscription.
133
     */
134 1
    public function setSubscriptionEnddate(DateTime $date)
135
    {
136 1
        $this->parameters['sub_enddate'] = $date->format('Y-m-d');
137 1
    }
138
139
    /**
140
     * Set subscription status
141
     * @author RenĂ© de Kat <[email protected]>
142
     *
143
     * @param integer $status   0 = inactive, 1 = active
144
     */
145 2
    public function setSubscriptionStatus($status)
146
    {
147 2
        if (!in_array($status, array(0, 1))) {
148 1
            throw new InvalidArgumentException("Invalid status specified for subscription. Possible values: 0 = inactive, 1 = active");
149
        }
150 1
        $this->parameters['sub_status'] = $status;
151 1
    }
152
153
    /**
154
     * Set comment for merchant
155
     * @author RenĂ© de Kat <[email protected]>
156
     *
157
     * @param string $comment
158
     */
159 3 View Code Duplication
    public function setSubscriptionComment($comment)
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...
160
    {
161 3
        if (strlen($comment) > 200) {
162 1
            throw new InvalidArgumentException("Subscription comment cannot be longer than 200 characters");
163
        }
164 2
        if (preg_match('/[^a-zA-Z0-9_ -]/', $comment)) {
165 1
            throw new InvalidArgumentException("Subscription comment cannot contain special characters");
166
        }
167 1
        $this->parameters['sub_comment'] = $comment;
168 1
    }
169
170 2
    public function getRequiredFields()
171
    {
172
        return array(
173 2
            'pspid', 'currency', 'orderid',
174
            'subscription_id', 'sub_amount', 'sub_com', 'sub_orderid', 'sub_period_unit',
175
            'sub_period_number', 'sub_period_moment','sub_startdate', 'sub_status'
176
        );
177
    }
178
}
179