Showing 12 of 59 total issues
Function getRows
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
public function getRows()
{
$rows = [];
$wheres = $this->queryBuilder->wheres ?: [];
- 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 getTableTags
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
private function getTableTags($tables, $rows)
{
$tags = [];
$type = $this->reflector->getType();
- 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 getTablesFromWhere
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
private function getTablesFromWhere(QueryBuilder $queryBuilder, &$tables) {
if (!isset($queryBuilder->wheres)) {
return;
}
$wheres = $queryBuilder->wheres ?: [];
- 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
Consider simplifying this complex logical expression. Open
if (($type === Reflector::QUERY_TYPE_SELECT && $isSpecific) ||
($type === Reflector::QUERY_TYPE_UPDATE && !$isSpecific) ||
($type === Reflector::QUERY_TYPE_DELETE && !$isSpecific) ||
($type === Reflector::QUERY_TYPE_TRUNCATE)) {
Function tablesCachable
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
private function tablesCachable()
{
$tables = $this->reflector->getTables();
if ($this->isInclusive()) {
- 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
Method __construct
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
ConnectionInterface $connection,
Grammar $grammar = null,
Processor $processor = null,
QueryHandler $handler,
Model $model = null
Method newPivot
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function newPivot(Model $parent, array $attributes, $table, $exists, $using = null)
Method endMeasuring
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
public function endMeasuring($type, $hash, $tags, $sql, $parameters)
Function getCompileFunction
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
private function getCompileFunction()
{
switch (strtolower($this->sqlOperation)) {
case self::QUERY_TYPE_INSERT:
return 'compileInsert';
- 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 'compileTruncate';
Avoid too many return
statements within this method. Open
return 'compileSelect';
Function getTags
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
public function getTags()
{
// Get affected database and tables, add prefixes
$database = $this->prefix($this->reflector->getDatabase(), self::PREFIX_DATABASE);
- 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"