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

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/Container/ServiceProvider.php (4 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
declare(strict_types=1);
4
5
/*
6
 * This file is part of the "php-ipfs" package.
7
 *
8
 * (c) Robert Schönthal <[email protected]>
9
 *
10
 * For the full copyright and license information, please view the LICENSE
11
 * file that was distributed with this source code.
12
 */
13
14
namespace IPFS\Container;
15
16
use Http\Client\Common\PluginClient;
17
use Http\Client\HttpAsyncClient;
18
use Http\Discovery\HttpAsyncClientDiscovery;
19
use Http\Discovery\MessageFactoryDiscovery;
20
use Http\Discovery\UriFactoryDiscovery;
21
use Http\Message\MessageFactory;
22
use Http\Message\UriFactory;
23
use IPFS\Api;
24
use IPFS\Console\ApiBuildCommand;
25
use IPFS\Console\CommandBuilder;
26
use IPFS\Driver\Cli;
27
use IPFS\Driver\Http;
28
use IPFS\Utils\AnnotationReader;
29
use phpDocumentor\Reflection\DocBlockFactory;
30
use PhpParser\BuilderFactory;
31
use Pimple\Container;
32
use Pimple\ServiceProviderInterface;
33
use Symfony\Component\Console\Application;
34
use Symfony\Component\DomCrawler\Crawler;
35
use Symfony\Component\Process\Process;
36
37
class ServiceProvider implements ServiceProviderInterface
38
{
39
    /**
40
     * {@inheritdoc}
41
     */
42 4
    public function register(Container $pimple)
43
    {
44 4
        $this->registerDriver($pimple);
0 ignored issues
show
The call to the method IPFS\Container\ServiceProvider::registerDriver() seems un-needed as the method has no side-effects.

PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.

Let’s take a look at an example:

class User
{
    private $email;

    public function getEmail()
    {
        return $this->email;
    }

    public function setEmail($email)
    {
        $this->email = $email;
    }
}

If we look at the getEmail() method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:

$user = new User();
$user->getEmail(); // This line could safely be removed as it has no effect.

On the hand, if we look at the setEmail(), this method _has_ side-effects. In the following case, we could not remove the method call:

$user = new User();
$user->setEmail('email@domain'); // This line has a side-effect (it changes an
                                 // instance variable).
Loading history...
45 4
        $this->registerConsole($pimple);
0 ignored issues
show
The call to the method IPFS\Container\ServiceProvider::registerConsole() seems un-needed as the method has no side-effects.

PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.

Let’s take a look at an example:

class User
{
    private $email;

    public function getEmail()
    {
        return $this->email;
    }

    public function setEmail($email)
    {
        $this->email = $email;
    }
}

If we look at the getEmail() method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:

$user = new User();
$user->getEmail(); // This line could safely be removed as it has no effect.

On the hand, if we look at the setEmail(), this method _has_ side-effects. In the following case, we could not remove the method call:

$user = new User();
$user->setEmail('email@domain'); // This line has a side-effect (it changes an
                                 // instance variable).
Loading history...
46
47
        $pimple[AnnotationReader::class] = function () {
48
            return new AnnotationReader(
49
                new \Doctrine\Common\Annotations\AnnotationReader(),
50
                DocBlockFactory::createInstance()
51
            );
52
        };
53
54
        $pimple[Api\ApiBuilder::class] = function () use ($pimple) {
55
            $this->registerHttp($pimple);
0 ignored issues
show
The call to the method IPFS\Container\ServiceProvider::registerHttp() seems un-needed as the method has no side-effects.

PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.

Let’s take a look at an example:

class User
{
    private $email;

    public function getEmail()
    {
        return $this->email;
    }

    public function setEmail($email)
    {
        $this->email = $email;
    }
}

If we look at the getEmail() method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:

$user = new User();
$user->getEmail(); // This line could safely be removed as it has no effect.

On the hand, if we look at the setEmail(), this method _has_ side-effects. In the following case, we could not remove the method call:

$user = new User();
$user->setEmail('email@domain'); // This line has a side-effect (it changes an
                                 // instance variable).
Loading history...
56
57
            $parser = new Api\ApiParser($pimple[HttpAsyncClient::class], $pimple[MessageFactory::class], new Crawler());
58
            $generator = new Api\ApiGenerator(new BuilderFactory());
59
60
            return new Api\ApiBuilder($parser, $generator);
61
        };
62 4
    }
63
64
    public function registerHttp(Container $pimple)
65
    {
66
        $pimple[HttpAsyncClient::class] = function () {
67
            return new PluginClient(
68
                HttpAsyncClientDiscovery::find(),
69
                []
70
            );
71
        };
72
73
        $pimple[MessageFactory::class] = function () {
74
            return MessageFactoryDiscovery::find();
75
        };
76
77
        $pimple[UriFactory::class] = function () {
78
            return UriFactoryDiscovery::find();
79
        };
80
    }
81
82 4
    private function registerDriver(Container $pimple)
83
    {
84
        $pimple[Http::class] = function () use ($pimple) {
85
            $this->registerHttp($pimple);
0 ignored issues
show
The call to the method IPFS\Container\ServiceProvider::registerHttp() seems un-needed as the method has no side-effects.

PHP Analyzer performs a side-effects analysis of your code. A side-effect is basically anything that might be visible after the scope of the method is left.

Let’s take a look at an example:

class User
{
    private $email;

    public function getEmail()
    {
        return $this->email;
    }

    public function setEmail($email)
    {
        $this->email = $email;
    }
}

If we look at the getEmail() method, we can see that it has no side-effect. Whether you call this method or not, no future calls to other methods are affected by this. As such code as the following is useless:

$user = new User();
$user->getEmail(); // This line could safely be removed as it has no effect.

On the hand, if we look at the setEmail(), this method _has_ side-effects. In the following case, we could not remove the method call:

$user = new User();
$user->setEmail('email@domain'); // This line has a side-effect (it changes an
                                 // instance variable).
Loading history...
86
87
            return new Http(
88
                $pimple[HttpAsyncClient::class],
89
                $pimple[MessageFactory::class],
90
                $pimple[UriFactory::class],
91
                $pimple[AnnotationReader::class],
92
                getenv('IPFS_API') ?: 'http://localhost:5001/api/v0'
93
            );
94
        };
95
96
        $pimple[Cli::class] = function () use ($pimple) {
97
            return new Cli(new Process([]), $pimple[AnnotationReader::class], getenv('IPFS_BINARY') ?: 'ipfs');
98
        };
99 4
    }
100
101 4
    private function registerConsole(Container $pimple)
102
    {
103
        $pimple[CommandBuilder::class] = function (Container $pimple) {
104
            $builder = new CommandBuilder([
105
                new Api\Basics(),
106
                new Api\Bitswap(),
107
                new Api\Block(),
108
                new Api\Bootstrap(),
109
                new Api\Config(),
110
                new Api\Dag(),
111
                new Api\Dht(),
112
                new Api\Diag(),
113
                new Api\File(),
114
                new Api\Files(),
115
                new Api\Filestore(),
116
                new Api\Key(),
117
                new Api\Log(),
118
                new Api\Name(),
119
                new Api\CObject(),
120
                new Api\P2p(),
121
                new Api\Pin(),
122
                new Api\Pubsub(),
123
                new Api\Refs(),
124
                new Api\Repo(),
125
                new Api\Stats(),
126
                new Api\Swarm(),
127
                new Api\Tar(),
128
            ], $pimple[AnnotationReader::class]);
129
130
            $builder->addDriver(Cli::class, $pimple->raw(Cli::class));
131
            $builder->addDriver(Http::class, $pimple->raw(Http::class));
132
133
            return $builder;
134
        };
135
136
        $pimple[Application::class] = function (Container $pimple) {
137
            $app = new Application('ipfs', '@git-version@');
138
            $app->addCommands($pimple[CommandBuilder::class]->generateCommands());
139
            $app->add(new ApiBuildCommand($pimple->raw(Api\ApiBuilder::class)));
140
141
            return $app;
142
        };
143 4
    }
144
}
145