fucongcong/framework

View on GitHub
core/Group/App/Bean.php

Summary

Maintainability
A
35 mins
Test Coverage

Showing 8 of 8 total issues

Function execution has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

private function execution($addr, $method, $parameters)
{
$aopConfig = Config::get("app::aop");
if (isset($aopConfig[$this->name][$addr][$method])) {
if (is_string($aopConfig[$this->name][$addr][$method])) {
Severity: Minor
Found in core/Group/App/Bean.php - About 35 mins to fix

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

} else {
foreach ($aopConfig[$this->name][$addr][$method] as $one) {
$this->callAspect($one, $parameters);
}
}
Severity: Minor
Found in core/Group/App/Bean.php by phpmd

Opening class brace must be on a line by itself
Open

{
Severity: Minor
Found in core/Group/App/Bean.php by phpcodesniffer

Expected 1 space after FUNCTION keyword; 0 found
Open

$aspect = app()->singleton($class, function() use ($class) {
Severity: Minor
Found in core/Group/App/Bean.php by phpcodesniffer

Whitespace found at end of line
Open

{
Severity: Minor
Found in core/Group/App/Bean.php by phpcodesniffer

Whitespace found at end of line
Open

{
Severity: Minor
Found in core/Group/App/Bean.php by phpcodesniffer

Whitespace found at end of line
Open

{
Severity: Minor
Found in core/Group/App/Bean.php by phpcodesniffer

Whitespace found at end of line
Open

{
Severity: Minor
Found in core/Group/App/Bean.php by phpcodesniffer
Category
Status