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.
Passed
Push — master ( 10351e...ea3c3c )
by Michael
03:35
created

MethodName::apply()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 10
Code Lines 6

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 8
CRAP Score 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 10
ccs 8
cts 8
cp 1
rs 9.4285
cc 2
eloc 6
nc 2
nop 1
crap 2
1
<?php
2
3
namespace MS\PHPMD\Rule\Naming;
4
5
use PHPMD\AbstractNode;
6
use PHPMD\AbstractRule;
7
use PHPMD\Node\MethodNode;
8
use PHPMD\Rule\MethodAware;
9
10
/**
11
 * Try to avoid meaningless method names. You or other developers don't understand what the method does in a few month.
12
 */
13
class MethodName extends AbstractRule implements MethodAware
14
{
15
    /**
16
     * @param AbstractNode|MethodNode $node
17
     */
18 6
    public function apply(AbstractNode $node)
19
    {
20 6
        $meaninglessNames = $this->getStringProperty('meaninglessNames');
21 6
        $delimiter = $this->getStringProperty('delimiter');
22 6
        $methodName = $node->getImage();
23
24 6
        if (in_array(strtolower($methodName), explode($delimiter, strtolower($meaninglessNames)))) {
25 2
            $this->addViolation($node, [$methodName, $meaninglessNames]);
26 2
        }
27 6
    }
28
}
29