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 ( 65539f...8ccec6 )
by Martin
9s
created

BrowscapPhp::hydrateDevice()   C

Complexity

Conditions 12
Paths 32

Size

Total Lines 23
Code Lines 11

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 12
CRAP Score 12

Importance

Changes 2
Bugs 0 Features 0
Metric Value
c 2
b 0
f 0
dl 0
loc 23
ccs 12
cts 12
cp 1
rs 5.2987
cc 12
eloc 11
nc 32
nop 2
crap 12

How to fix   Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
2
namespace UserAgentParser\Provider;
3
4
class BrowscapPhp extends AbstractBrowscap
5
{
6
    /**
7
     * Name of the provider
8
     *
9
     * @var string
10
     */
11
    protected $name = 'BrowscapPhp';
12
13
    protected $detectionCapabilities = [
14
15
        'browser' => [
16
            'name'    => true,
17
            'version' => true,
18
        ],
19
20
        'renderingEngine' => [
21
            'name'    => false,
22
            'version' => false,
23
        ],
24
25
        'operatingSystem' => [
26
            'name'    => true,
27
            'version' => false,
28
        ],
29
30
        'device' => [
31
            'model'    => false,
32
            'brand'    => false,
33
            'type'     => true,
34
            'isMobile' => true,
35
            'isTouch'  => true,
36
        ],
37
38
        'bot' => [
39
            'isBot' => true,
40
            'name'  => true,
41
            'type'  => false,
42
        ],
43
    ];
44
}
45