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.
Test Failed
Push — master ( ea3c3c...758782 )
by Michael
03:51
created

DataStructureGuesser   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A isDataStructure() 0 12 3
getRegex() 0 1 ?
1
<?php
2
3
namespace MS\PHPMD\Guesser;
4
5
use PDepend\Source\AST\ASTClass;
6
use PHPMD\Node\ClassNode;
7
8
/**
9
 */
10
trait DataStructureGuesser
11
{
12
    /**
13
     * @param ClassNode|ASTClass $node
14
     *
15
     * @return bool
16
     */
17
    protected function isDataStructure(ClassNode $node)
18
    {
19
        if (0 < preg_match($this->getRegex('dataStructureNamespaceRegex'), $node->getNamespaceName())) {
20
            return true;
21
        }
22
23
        if (0 < preg_match($this->getRegex('dataStructureCommentRegex'), $node->getComment())) {
24
            return true;
25
        }
26
27
        return false;
28
    }
29
30
    /**
31
     * @param string $name
32
     *
33
     * @return string
34
     */
35
    abstract protected function getRegex($name);
36
}
37