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.
Completed
Push — master ( fee33a...ddc175 )
by Jan-Petter
02:52
created

MatchTest   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 34
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 2
dl 34
loc 34
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A testMatch() 6 6 1
A generateDataForTest() 15 15 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
namespace vipnytt\UserAgentParser\Tests;
3
4
use vipnytt\UserAgentParser;
5
6
/**
7
 * Class MatchTest
8
 *
9
 * @package vipnytt\UserAgentParser\Tests
10
 */
11 View Code Duplication
class MatchTest extends \PHPUnit_Framework_TestCase
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...
12
{
13
    /**
14
     * @dataProvider generateDataForTest
15
     * @param string $userAgent
16
     * @param array $array
17
     */
18
    public function testMatch($userAgent, $array)
19
    {
20
        $parser = new UserAgentParser($userAgent);
21
        $this->assertInstanceOf('vipnytt\UserAgentParser', $parser);
22
        $this->assertNotFalse($parser->match($array));
23
    }
24
25
    /**
26
     * Generate test data
27
     * @return array
28
     */
29
    public
30
    function generateDataForTest()
31
    {
32
        return [
33
            [
34
                'googlebot-news/2.1',
35
                [
36
                    'googlebot-news',
37
                    'googlebot-images',
38
                    'googlebot-news/2.0',
39
                    'googlebot',
40
                ]
41
            ]
42
        ];
43
    }
44
}
45