Showing 1,397 of 1,397 total issues
Function execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function execute(CommandContext $context)
{
if(!\Current_User::allow('hms', 'reports')){
throw new PermissionException('You do no have permission to run reports.');
}
- Read upRead up
- Create a ticketCreate a ticket
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 execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function execute(CommandContext $context)
{
$requestId = $context->get('requestId');
$mealPlanCode = $context->get('mealPlan');
- Read upRead up
- Create a ticketCreate a ticket
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 execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function execute(CommandContext $context){
$term = $context->get('term');
if(!isset($term) || is_null($term) || empty($term)){
throw new \InvalidArgumentException('Missing term.');
- Read upRead up
- Create a ticketCreate a ticket
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 deeply nested control flow statements. Open
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
switch (ch) {
case 'n':
cooked += '\n';
break;
case 'r':
- Create a ticketCreate a ticket
Function execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function execute(CommandContext $context)
{
// Make sure we have a valid term
$term = $context->get('term');
- Read upRead up
- Create a ticketCreate a ticket
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 deeply nested control flow statements. Open
if (tmp && tmp.type === Syntax.SpreadElement) {
if (!match(']')) {
throwError({}, Messages.ElementAfterSpreadElement);
}
} else if (!(match(']') || matchKeyword('for') || matchKeyword('if'))) {
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (ch === '\r' && source[index] === '\n') {
++index;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (expr.type !== Syntax.MemberExpression && expr.type !== Syntax.CallExpression && expr.type !== Syntax.NewExpression) {
throwError({}, Messages.InvalidLHSInAssignment);
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (!checkToken) {
return scanRegExp();
}
- Create a ticketCreate a ticket
Method __construct
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function __construct($roomId, $bannerId, $damageType, $checkoutId, $splitWithRoommate, $reportedBy)
- Create a ticketCreate a ticket
Function execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function execute(CommandContext $context)
{
if(!UserStatus::isAdmin() || !\Current_User::allow('hms', 'bed_structure')){
throw new PermissionException('You do not have permission to add a bed.');
}
- Read upRead up
- Create a ticketCreate a ticket
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 deeply nested control flow statements. Open
if (strict && kind === PropertyKind.Data) {
throwErrorTolerant({}, Messages.StrictDuplicateProperty);
} else if (kind !== PropertyKind.Data) {
throwErrorTolerant({}, Messages.AccessorDataProperty);
}
- Create a ticketCreate a ticket
Function execute
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
public function execute(CommandContext $context)
{
if (!UserStatus::isAdmin() || !\Current_User::allow('hms', 'assign_by_floor')) {
throw new PermissionException('You do not have permission to assign students by floor.');
}
- Read upRead up
- Create a ticketCreate a ticket
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 deeply nested control flow statements. Open
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (ch === '\r' && source[index] === '\n') {
++index;
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (isOctalDigit(ch)) {
code = '01234567'.indexOf(ch);
// \0 is not octal escape sequence
if (code !== 0) {
- Create a ticketCreate a ticket
Method reportRoomAssignment
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
public function reportRoomAssignment($username, $term, $building, $room, $plan = 'HOME', $meal)
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
if (kind === PropertyKind.Data) {
throwErrorTolerant({}, Messages.AccessorDataProperty);
} else if (storedKind & kind) {
throwErrorTolerant({}, Messages.AccessorGetSet);
}
- Create a ticketCreate a ticket
Avoid deeply nested control flow statements. Open
} else if (i + 1 === length) {
// unpaired lead
if ((units -= 3) > -1) bytes.push(0xEF, 0xBF, 0xBD)
continue
} else {
- Create a ticketCreate a ticket