Showing 5 of 6 total issues
Method rest
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function rest($pattern, $model = null, $methods = ['read', 'modify', 'delete']) { $methods = array_map('strtolower', $methods); // GET all records
Function rest
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
public function rest($pattern, $model = null, $methods = ['read', 'modify', 'delete']) { $methods = array_map('strtolower', $methods); // GET all records
- Read upRead up
Method match
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
public function match($pattern) { $path = explode('/', rtrim($this->path, '/')); $pattern = explode('/', rtrim($pattern, '/'));
Method init
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
protected function init(): void { parent::init(); $this->addField('name', ['actual' => 'nicename', 'required' => true, 'type' => 'string']);
Avoid too many return
statements within this method. Open
Open
return !$model->delete($id)->loaded();