Showing 84 of 177 total issues
Avoid deeply nested control flow statements. Open
} else if (action === 'cancel' && currentModal.reject) {
currentModal.reject(action);
}
Avoid deeply nested control flow statements. Open
if (instance.showInput) {
currentModal.resolve({ value: instance.inputValue, action });
} else {
currentModal.resolve(action);
}
Function responseErrorInterceptor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
const responseErrorInterceptor = error => {
setLoading(false);
if (!has(error, 'response.status') || (error.request.responseType === 'blob' && error.request.status === 404)) {
return Promise.reject(error);
- 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
Function dispatch
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function dispatch($event, mixed $payload = [], $halt = false): mixed
{
foreach ($this->getListeners($event) as $listener) {
$response = $listener($event, $payload);
- 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
Function hasRoleInAnyProject
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
final public function hasRoleInAnyProject(Role|array $role): bool
{
$self = $this;
$roles = Cache::store('octane')->remember(
"role_any_project_$self->id",
- 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
Function up
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function up()
{
$user_role_id = 2;
$manager_role_id = 5;
$blocked_role_id = 255;
- 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
Function init
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function init(context, router) {
const crud = context.createCrud('time_intervals.crud_title', 'time-intervals', TimeIntervalService);
crud.new.addToMetaProperties('permissions', 'time-intervals/create', crud.new.getRouterConfig());
crud.new.addToMetaProperties('afterSubmitCallback', () => router.go(-1), crud.new.getRouterConfig());
- 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
Function getRelationsFilter
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private static function getRelationsFilter(array $filter): array
{
$key = array_search('can', $filter, true);
if ($key !== false) {
array_splice($filter, $key, 1);
- 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
Function solve
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function solve(string $captchaToken = ''): void
{
if (!$this->captchaEnabled()) {
return;
}
- 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
Function handle
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function handle(): int
{
if (!$this->option('force') && !$this->confirm('Are you sure want to drop data for your Cattr instance?')) {
return 0;
}
- 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
Avoid too many return
statements within this method. Open
return;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return $filter;
Avoid too many return
statements within this method. Open
return 0;
Avoid too many return
statements within this method. Open
return 1;
Avoid too many return
statements within this function. Open
return choicesLength < 4 ? 2 : 3;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return $this->_edit($request);
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return $this->_create($request);