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.

Stats   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 45
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 1
dl 45
loc 45
c 0
b 0
f 0
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A bitswap() 4 4 1
A bw() 4 4 1
A repo() 4 4 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

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\Api;
15
16
use IPFS\Annotation\Api as Endpoint;
17
use IPFS\Command\Command;
18
19
/**
20
 * @author Robert Schönthal <[email protected]>
21
 * @autogenerated
22
 * @codeCoverageIgnore
23
 */
24 View Code Duplication
final class Stats implements Api
0 ignored issues
show
Duplication introduced by
This class 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...
25
{
26
    /**
27
     * Show some diagnostic information on the bitswap agent.
28
     *
29
     * @Endpoint(name="stats:bitswap")
30
     *
31
     * @return Command
32
     */
33
    public function bitswap(): Command
34
    {
35
        return new Command(__METHOD__, get_defined_vars());
36
    }
37
38
    /**
39
     * Print ipfs bandwidth information.
40
     *
41
     * @Endpoint(name="stats:bw")
42
     *
43
     * @param string $peer     specify a peer to print bandwidth for
44
     * @param string $proto    specify a protocol to print bandwidth for
45
     * @param bool   $poll     print bandwidth at an interval
46
     * @param string $interval time interval to wait between updating output, if ‘poll’ is true
47
     *
48
     * @return Command
49
     */
50
    public function bw(string $peer = null, string $proto = null, bool $poll = false, string $interval = null): Command
51
    {
52
        return new Command(__METHOD__, get_defined_vars());
53
    }
54
55
    /**
56
     * Get stats for the currently used repo.
57
     *
58
     * @Endpoint(name="stats:repo")
59
     *
60
     * @param bool $human output RepoSize in MiB
61
     *
62
     * @return Command
63
     */
64
    public function repo(bool $human = false): Command
65
    {
66
        return new Command(__METHOD__, get_defined_vars());
67
    }
68
}
69