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

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.

Tests/Unit/Library/QuantumViewTest.php (3 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 Octante\UpsAPIBundle\Tests\Unit\Library;
4
5
/*
6
 * This file is part of the UpsAPIBundle package.
7
 *
8
 * (c) Issel Guberna <[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
use Octante\UpsAPIBundle\Library\QuantumViewWrapper;
15
16
class QuantumViewTest extends \PHPUnit_Framework_TestCase
17
{
18
    /**
19
     * @var
20
     */
21
    private $quantumViewMock;
22
23
    public function setUp()
24
    {
25
        $this->quantumViewMock = $this->getMock('Ups\QuantumView');
26
    }
27
28
    /**
29
     * when: getSubscriptionIsCalled
30
     * should: callUpsQuantumViewGetSubscriptionMethod.
31
     */
32
    public function testQuantumViewGetSubscriptionMethodIsCalled()
33
    {
34
        $name = 'name';
35
        $beginDateTime = 'begin date time';
36
        $endDateTime = 'end date time';
37
        $fileName = 'filename';
38
        $bookmark = 'bookmark';
39
40
        $this
41
            ->quantumViewMock
42
            ->expects($this->once())
43
            ->method('getSubscription')
44
            ->with(
45
                $name,
46
                $beginDateTime,
47
                $endDateTime,
48
                $fileName,
49
                $bookmark
50
            );
51
52
        $sut = new QuantumViewWrapper($this->quantumViewMock);
53
54
        $sut->getSubscription(
55
            $name,
56
            $beginDateTime,
57
            $endDateTime,
58
            $fileName,
59
            $bookmark
60
        );
61
    }
62
63
    /**
64
     * when: getBookmarkIsCalled
65
     * should: callUpsQuantumViewGetBookmarkMethod.
66
     */
67
    public function testQuantumViewGetBookmarkMethodIsCalled()
68
    {
69
        $sut = new QuantumViewWrapper($this->quantumViewMock);
70
71
        $this
72
            ->quantumViewMock
73
            ->expects($this->once())
74
            ->method('getBookmark');
75
76
        $sut->getBookmark();
0 ignored issues
show
The call to the method Octante\UpsAPIBundle\Lib...wWrapper::getBookmark() 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...
77
    }
78
79
    /**
80
     * when: hasBookmarkIsCalled
81
     * should: callUpsQuantumViewHasBookmarkMethod.
82
     */
83
    public function testQuantumViewHasBookmarkMethodIsCalled()
84
    {
85
        $sut = new QuantumViewWrapper($this->quantumViewMock);
86
87
        $this
88
            ->quantumViewMock
89
            ->expects($this->once())
90
            ->method('hasBookmark');
91
92
        $sut->hasBookmark();
0 ignored issues
show
The call to the method Octante\UpsAPIBundle\Lib...wWrapper::hasBookmark() 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...
93
    }
94
95
    /**
96
     * when: setBookmarkIsCalled
97
     * should: callUpsQuantumViewSetBookmarkMethod.
98
     */
99
    public function testQuantumViewSetBookmarkMethodIsCalled()
100
    {
101
        $sut = new QuantumViewWrapper($this->quantumViewMock);
102
        $bookmarkMock = 'bookmark name';
103
104
        $this
105
            ->quantumViewMock
106
            ->expects($this->once())
107
            ->method('setBookmark')
108
            ->with($bookmarkMock);
109
110
        $sut->setBookmark($bookmarkMock);
111
    }
112
113
    /**
114
     * when: getRequestIsCalled
115
     * should: callUpsQuantumViewGetRequestMethod.
116
     */
117
    public function testQuantumViewGetRequestMethodIsCalled()
118
    {
119
        $requestMock = $this->getMock('Ups\Request');
120
        $this
121
            ->quantumViewMock
122
            ->method('getRequest')
123
            ->willReturn($requestMock);
124
125
        $sut = new QuantumViewWrapper($this->quantumViewMock);
126
        $sut->setRequest($requestMock);
127
        $request = $sut->getRequest();
128
        $this->assertInstanceOf('Ups\Request', $request);
129
    }
130
131
    /**
132
     * when: getResponseIsCalled
133
     * should: callUpsGetResponseMethod.
134
     */
135 View Code Duplication
    public function testQuantumViewGetResponseMethodIsCalled()
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...
136
    {
137
        $responseMock = $this->getMock('Ups\Response');
138
        $this
139
            ->quantumViewMock
140
            ->method('getResponse')
141
            ->willReturn($responseMock);
142
143
        $sut = new QuantumViewWrapper($this->quantumViewMock);
144
        $sut->setResponse($responseMock);
145
        $response = $sut->getResponse();
146
        $this->assertInstanceOf('Ups\Response', $response);
147
    }
148
}
149