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

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.

src/Endpoints/Feeds.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
namespace Mozammil\Putio\Endpoints;
4
5
use Mozammil\Putio\Http\Client;
6
7
class Feeds
8
{
9
    /**
10
     * The Http Client.
11
     *
12
     * @var \Mozammil\Putio\Http\Client
13
     */
14
    protected $client;
15
16
    public function __construct(Client $client)
17
    {
18
        $this->client = $client;
19
    }
20
21
    /**
22
     * Creates an RSS feed with the given parameters.
23
     *
24
     * @param string $title Title of the RSS feed as will appear on the site
25
     * @param string $rss_source_url The URL of the RSS feed to be watched
26
     * @param int $parent_dir_id The file ID of the folder to place the RSS feed files in
27
     * @param bool $delete_old_files Should old files in the folder be deleted when space is low
28
     * @param bool $dont_process_whole_feed Should the current items in the feed, at creation time, be ignored
29
     * @param array $keywords Only items with titles that contain any of these words will be transferred
30
     * @param array $unwanted_keywords No items with titles that contain any of these words will be transferred
31
     * @param bool $paused Should the RSS feed be created in the paused state
32
     *
33
     * @throws \GuzzleHttp\Exception\GuzzleException
34
     *
35
     * @see https://api.put.io/v2/docs/feeds.html#post--rss-create
36
     *
37
     * @return string
38
     */
39 View Code Duplication
    public function create(
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...
40
        string $title,
41
        string $rss_source_url,
42
        int $parent_dir_id = 0,
43
        bool $delete_old_files = false,
44
        bool $dont_process_whole_feed = false,
45
        array $keywords = [],
46
        array $unwanted_keywords = [],
47
        bool $paused = false
48
    ) {
49
        return $this->client->post('rss/create', [
50
            'form_params' => [
51
                'title' => $title,
52
                'rss_source_url' => $rss_source_url,
53
                'parent_dir_id' => $parent_dir_id,
54
                'delete_old_files' => $delete_old_files,
55
                'dont_process_whole_feed' => $dont_process_whole_feed,
56
                'keywords' => count($keywords) ? implode(',', $keywords) : null,
57
                'unwanted_keywords' => count($unwanted_keywords) ? implode(',', $unwanted_keywords) : null,
58
                'paused' => $paused,
59
            ],
60
        ]);
61
    }
62
63
    /**
64
     * Lists RSS feeds.
65
     *
66
     * @throws \GuzzleHttp\Exception\GuzzleException
67
     *
68
     * @see https://api.put.io/v2/docs/feeds.html#get--rss-list
69
     *
70
     * @return string
71
     */
72
    public function list()
73
    {
74
        return $this->client->get('rss/list');
75
    }
76
77
    /**
78
     * Gives detailed information about the given feed id.
79
     *
80
     * @param int $id
81
     *
82
     * @throws \GuzzleHttp\Exception\GuzzleException
83
     *
84
     * @see https://api.put.io/v2/docs/feeds.html#get--rss-list
85
     *
86
     * @return string
87
     */
88
    public function get(int $id)
89
    {
90
        return $this->client->get(sprintf('rss/%d', $id));
91
    }
92
93
    /**
94
     * Updates an RSS feed with the given parameters.
95
     *
96
     * @param int $id Id of the RSS feed to be updated
97
     * @param string $title Title of the RSS feed as will appear on the site
98
     * @param string $rss_source_url The URL of the RSS feed to be watched
99
     * @param int $parent_dir_id The file ID of the folder to place the RSS feed files in
100
     * @param bool $delete_old_files Should old files in the folder be deleted when space is low
101
     * @param bool $dont_process_whole_feed Should the current items in the feed, at creation time, be ignored
102
     * @param array $keywords Only items with titles that contain any of these words will be transferred
103
     * @param array $unwanted_keywords No items with titles that contain any of these words will be transferred
104
     * @param bool $paused Should the RSS feed be created in the paused state
105
     *
106
     * @throws \GuzzleHttp\Exception\GuzzleException
107
     *
108
     * @see https://api.put.io/v2/docs/feeds.html#update
109
     *
110
     * @return string
111
     */
112 View Code Duplication
    public function update(
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...
113
        int $id,
114
        string $title,
115
        string $rss_source_url,
116
        int $parent_dir_id = 0,
117
        bool $delete_old_files = false,
118
        bool $dont_process_whole_feed = false,
119
        array $keywords = [],
120
        array $unwanted_keywords = [],
121
        bool $paused = false
122
    ) {
123
        return $this->client->post(sprintf('rss/%d', $id), [
124
            'form_params' => [
125
                'title' => $title,
126
                'rss_source_url' => $rss_source_url,
127
                'parent_dir_id' => $parent_dir_id,
128
                'delete_old_files' => $delete_old_files,
129
                'dont_process_whole_feed' => $dont_process_whole_feed,
130
                'keywords' => count($keywords) ? implode(',', $keywords) : null,
131
                'unwanted_keywords' => count($unwanted_keywords) ? implode(',', $unwanted_keywords) : null,
132
                'paused' => $paused,
133
            ],
134
        ]);
135
    }
136
137
    /**
138
     * Pauses the RSS feed, so that it is not polled for new items anymore.
139
     *
140
     * @param int $id
141
     *
142
     * @throws \GuzzleHttp\Exception\GuzzleException
143
     *
144
     * @see https://api.put.io/v2/docs/feeds.html#post--rss--feed_id--pause
145
     *
146
     * @return string
147
     */
148
    public function pause(int $id)
149
    {
150
        return $this->client->post(sprintf('rss/%d/pause', $id));
151
    }
152
153
    /**
154
     * Resumes the RSS feed, so that it starts being polled for new items again.
155
     *
156
     * @param int $id
157
     *
158
     * @throws \GuzzleHttp\Exception\GuzzleException
159
     *
160
     * @see https://api.put.io/v2/docs/feeds.html#post--rss--feed_id--resume
161
     *
162
     * @return string
163
     */
164
    public function resume(int $id)
165
    {
166
        return $this->client->post(sprintf('rss/%d/resume', $id));
167
    }
168
169
    /**
170
     * Deletes given RSS feed.
171
     *
172
     * @param int $id
173
     *
174
     * @throws \GuzzleHttp\Exception\GuzzleException
175
     *
176
     * @see https://api.put.io/v2/docs/feeds.html#post--rss--feed_id--delete
177
     *
178
     * @return string
179
     */
180
    public function delete(int $id)
181
    {
182
        return $this->client->post(sprintf('rss/%d/delete', $id));
183
    }
184
}
185