Showing 9 of 9 total issues
Function validateRole
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Open
public function validateRole($inputs, $idRole = null)
{
$role = Role::where(function ($query) use ($inputs) {
$query->where('name', $inputs['name'])
->orWhere('slug', $inputs['slug'])
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Each class must be in a file by itself Open
Open
class HelperRepository {
- Exclude checks
Opening brace of a class must be on the line after the definition Open
Open
class HelperRepository {
- Exclude checks
Function validatePermission
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
public function validatePermission($inputs, $idPermission = null)
{
$permission = Permission::where(function ($query) use ($inputs) {
$query->where('name', $inputs['permissiondialog_name'])
->orWhere('description', $inputs['permissiondialog_description']);
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Spaces must be used to indent lines; tabs are not allowed Open
Open
- Exclude checks
Spaces must be used to indent lines; tabs are not allowed Open
Open
- Exclude checks
Opening brace should be on a new line Open
Open
public function getFilters() { }
- Exclude checks
Expected 1 newline at end of file; 0 found Open
Open
}
- Exclude checks
Closing brace must be on a line by itself Open
Open
public function getFilters() { }
- Exclude checks