Showing 69 of 84 total issues
Avoid too many return
statements within this method. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return true;
- Create a ticketCreate a ticket
Avoid too many return
statements within this method. Open
return true;
- Create a ticketCreate a ticket
Function whereIn
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function whereIn(array $conditions, bool $invert=false) :self {
// for each provided strict condition
foreach($conditions as $column => $values) {
// if we have to conditions
if(!is_array($values) || empty($values)) {
- 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 detectActionAndTable
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function detectActionAndTable() {
// detetect the action
$action = substr($this->Query, 0, 6);
// if action can alter a table (INSERT, UPDATE, DELETE)
if(in_array($action, array('INSERT', 'UPDATE', 'DELETE', 'SELECT'))) {
- 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 save
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function save() :bool {
// if nothing has changed on this object
if(!count($this->_['altered'])) {
// we consider the object saved without touching the database
- 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 duration
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public static function duration(
int $seconds = null,
int $precision = 0
) :string {
- 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 authenticateByForm
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
protected static function authenticateByForm() :void {
// look for users with this login
$account = \Models\Accounts::getByLogin(
Request::post( Config::get('security', 'login') )
- 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 deduceAttributesFromFilters
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
private function deduceAttributesFromFilters(string $column) :array {
// default attributes
$attributes = [];
- 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"