Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Completed
Push — 0.9 ( 7d978d...1ce8ac )
by Henrique
07:01 queued 01:39
created

IpException   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 43
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 5
c 1
b 0
f 0
lcom 0
cbo 1
dl 0
loc 43
ccs 15
cts 15
cp 1
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A configure() 0 17 3
A chooseTemplate() 0 8 2
1
<?php
2
namespace Respect\Validation\Exceptions;
3
4
class IpException extends ValidationException
5
{
6
    const STANDARD = 0;
7
    const NETWORK_RANGE = 1;
8
9
    public static $defaultTemplates = array(
10
        self::MODE_DEFAULT => array(
11
            self::STANDARD => '{{name}} must be an IP address',
12
            self::NETWORK_RANGE => '{{name}} must be an IP address in the {{range}} range',
13
        ),
14
        self::MODE_NEGATIVE => array(
15
            self::STANDARD => '{{name}} must not be an IP address',
16
            self::NETWORK_RANGE => '{{name}} must not be an IP address in the {{range}} range',
17
        ),
18
    );
19
20 14
    public function configure($name, array $params = array())
21
    {
22 14
        if ($params['networkRange']) {
23 9
            $range = $params['networkRange'];
24 9
            $message = $range['min'];
25
26 9
            if (isset($range['max'])) {
27 6
                $message .= '-'.$range['max'];
28 6
            } else {
29 3
                $message .= '/'.long2ip($range['mask']);
30
            }
31
32 9
            $params['range'] = $message;
33 9
        }
34
35 14
        return parent::configure($name, $params);
36
    }
37
38 14
    public function chooseTemplate()
39
    {
40 14
        if (!$this->getParam('networkRange')) {
41 5
            return static::STANDARD;
42
        } else {
43 9
            return static::NETWORK_RANGE;
44
        }
45
    }
46
}
47