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

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/Pinterest/Pinterest.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
 * Copyright 2015 Dirk Groenen
4
 *
5
 * (c) Dirk Groenen <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace DirkGroenen\Pinterest;
12
13
use DirkGroenen\Pinterest\Auth\PinterestOAuth;
14
use DirkGroenen\Pinterest\Utils\CurlBuilder;
15
use DirkGroenen\Pinterest\Transport\Request;
16
use DirkGroenen\Pinterest\Exceptions\InvalidEndpointException;
17
18
/**
19
 * @property \DirkGroenen\Pinterest\Endpoints\Boards boards
20
 * @property \DirkGroenen\Pinterest\Endpoints\Following following
21
 * @property \DirkGroenen\Pinterest\Endpoints\Pins pins
22
 * @property \DirkGroenen\Pinterest\Endpoints\Users users
23
 * @property \DirkGroenen\Pinterest\Endpoints\Sections sections
24
 */
25
class Pinterest {
26
27
    /**
28
     * Reference to authentication class instance
29
     *
30
     * @var Auth\PinterestOAuth
31
     */
32
    public $auth;
33
34
    /**
35
     * A reference to the request class which travels
36
     * through the application
37
     *
38
     * @var Transport\Request
39
     */
40
    public $request;
41
42
    /**
43
     * A array containing the cached endpoints
44
     *
45
     * @var array
46
     */
47
    private $cachedEndpoints = [];
48
49
    /**
50
     * Constructor
51
     *
52
     * @param  string       $client_id
53
     * @param  string       $client_secret
54
     * @param  CurlBuilder  $curlbuilder
55
     */
56 43
    public function __construct($client_id, $client_secret, $curlbuilder = null)
57
    {
58 43
        if ($curlbuilder == null) {
59
            $curlbuilder = new CurlBuilder();
60
        }
61
62
        // Create new instance of Transport\Request
63 43
        $this->request = new Request($curlbuilder);
64
65
        // Create and set new instance of the OAuth class
66 43
        $this->auth = new PinterestOAuth($client_id, $client_secret, $this->request);
67 43
    }
68
69
    /**
70
     * Get an Pinterest API endpoint
71
     *
72
     * @access public
73
     * @param string    $endpoint
74
     * @return mixed
75
     * @throws Exceptions\InvalidEndpointException
76
     */
77 39
    public function __get($endpoint)
78
    {
79 39
        $endpoint = strtolower($endpoint);
80 39
        $class = "\\DirkGroenen\\Pinterest\\Endpoints\\" . ucfirst($endpoint);
81
82
        // Check if an instance has already been initiated
83 39
        if (!isset($this->cachedEndpoints[$endpoint])) {
84
            // Check endpoint existence
85 39
            if (!class_exists($class)) {
86
                throw new InvalidEndpointException;
87
            }
88
89
            // Create a reflection of the called class and initialize it
90
            // with a reference to the request class
91 39
            $ref = new \ReflectionClass($class);
92 39
            $obj = $ref->newInstanceArgs([$this->request, $this]);
93
94 39
            $this->cachedEndpoints[$endpoint] = $obj;
95
        }
96
97 39
        return $this->cachedEndpoints[$endpoint];
98
    }
99
100
    /**
101
     * Get rate limit from the headers
102
     * response header may change from X-Ratelimit-Limit to X-RateLimit-Limit
103
     * @access public
104
     * @return integer
105
     */
106 1 View Code Duplication
    public function getRateLimit()
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...
107
    {
108 1
        $header = $this->request->getHeaders();
109 1
        if (is_array($header)) {
110
            $header = array_change_key_case($header, CASE_LOWER);
111
        }
112 1
        return (isset($header['x-ratelimit-limit']) ? $header['x-ratelimit-limit'] : 1000);
113
    }
114
115
    /**
116
     * Get rate limit remaining from the headers
117
     * response header may change from X-Ratelimit-Remaining to X-RateLimit-Remaining
118
     * @access public
119
     * @return mixed
120
     */
121 1 View Code Duplication
    public function getRateLimitRemaining()
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...
122
    {
123 1
        $header = $this->request->getHeaders();
124 1
        if (is_array($header)) {
125
            $header = array_change_key_case($header, CASE_LOWER);
126
        }
127 1
        return (isset($header['x-ratelimit-remaining']) ? $header['x-ratelimit-remaining'] : 'unknown');
128
    }
129
}
130