fucongcong/framework

View on GitHub
core/Group/Redis/RedisHelper.php

Summary

Maintainability
A
0 mins
Test Coverage

Showing 4 of 4 total issues

The method hashKey uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
if (strlen($id) > 2) {
$shang = substr($id, 0,-2);
return [$prefix.':'.$shang, substr($id, -2)];
} else {
Severity: Minor
Found in core/Group/Redis/RedisHelper.php by phpmd

The method hashKey uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
Open

} else {
return [$prefix.':', $id];
}
Severity: Minor
Found in core/Group/Redis/RedisHelper.php by phpmd

Avoid variables with short names like $id. Configured minimum length is 3.
Open

public static function hashKey($prefix, $id)
Severity: Minor
Found in core/Group/Redis/RedisHelper.php by phpmd

No space found after comma in function call
Open

$shang = substr($id, 0,-2);
Category
Status