MD5Hasher   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 4
lcom 0
cbo 0
dl 0
loc 16
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A make() 0 6 2
A check() 0 6 2
1
<?php
2
/* User:lyt123; Date:2017/4/20; QQ:1067081452 */
0 ignored issues
show
Unused Code Comprehensibility introduced by
40% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
3
4
namespace Ivanlin\Hasher;
5
6
class MD5Hasher
7
{
8 2
    public function make($value, array $options = [])
9
    {
10 2
        $salt = isset($options['salt']) ? $options['salt'] : '';
11
12 2
        return hash('md5', $value . $salt);
13
    }
14
15 1
    public function check($value, $hashValue, array $options = [])
16
    {
17 1
        $salt = isset($options['salt']) ? $options['salt'] : '';
18
19 1
        return hash('md5', $value . $salt) === $hashValue;
20
    }
21
}