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

Slug   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%
Metric Value
wmc 4
lcom 0
cbo 1
dl 0
loc 19
ccs 8
cts 8
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A validate() 0 16 4
1
<?php
2
namespace Respect\Validation\Rules;
3
4
class Slug extends AbstractRule
5
{
6 13
    public function validate($input)
7
    {
8 13
        if (strstr($input, '--')) {
9 2
            return false;
10
        }
11
12 11
        if (!preg_match('@^[0-9a-z\-]+$@', $input)) {
13 5
            return false;
14
        }
15
16 6
        if (preg_match('@^-|-$@', $input)) {
17 2
            return false;
18
        }
19
20 4
        return true;
21
    }
22
}
23