Showing 251 of 1,173 total issues
Function pluralToSingular
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function pluralToSingular($string)
{
// save some time in the case that singular and plural are the same
if (in_array(strtolower($string), $this->uncountable)) {
return $string;
- 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 mapRowsToObjects
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function mapRowsToObjects(array $rows, array $tables = [])
{
/**
* Initialize $mappedObjects.
*/
- 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 addRequiredRule
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function addRequiredRule()
{
$inputs = $this->getDefinedInputs();
if (!empty($inputs)) {
foreach ($inputs as $input) {
- 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 insertQuery
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public function insertQuery(array $fieldsValues)
{
if (empty($fieldsValues)) {
throw new \Exception('fieldsValues cannot be empty in insertQuery function');
}
- 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 $output;
Avoid too many return
statements within this method. Open
return (new UserAuthentication())->forgetPassword($user);
Avoid too many return
statements within this method. Open
return $output;
Avoid too many return
statements within this function. Open
if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'
Avoid too many return
statements within this function. Open
return false
Avoid too many return
statements within this method. Open
return $loggedIn[$roles[$routeInfo->getAccessRole()]['user']];
Avoid too many return
statements within this method. Open
return $output;
Avoid too many return
statements within this method. Open
return (new UserAuthentication())->resetPassword($user, $resetPasswordToken, $password, $passwordConfirmation);
Avoid too many return
statements within this method. Open
return $output;
Avoid too many return
statements within this method. Open
return $finalOutput;
Avoid too many return
statements within this method. Open
return $output;
Avoid too many return
statements within this method. Open
return true;
Avoid too many return
statements within this method. Open
return false;
Avoid too many return
statements within this method. Open
return true;
Function batchDeleteGroup
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function batchDeleteGroup()
{
$inputs = (new Request('POST'))->getInputs();
/**
- 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 batchDeleteMessage
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function batchDeleteMessage()
{
$inputs = (new Request('POST'))->getInputs();
/**
- 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"