Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

Test Failed
Push — optimize-queries ( 9b3855 )
by Pedro
12:20
created

QueryBuilder   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 19
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 7
dl 0
loc 19
rs 10
c 1
b 0
f 0
wmc 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A runSelect() 0 12 2
1
<?php
2
3
namespace Backpack\CRUD\app\Library\Database;
4
5
use Illuminate\Database\Query\Builder;
6
7
class QueryBuilder extends Builder
8
{
9
    /**
10
     * Run the query as a "select" statement against the connection.
11
     *
12
     * @return array
13
     */
14
    protected function runSelect()
15
    {
16
        $query = base64_encode(json_encode([$this->toSql() => $this->getBindings()]));
17
18
        if (app('crud')->hasQuery($query)) {
19
            return app('crud')->getQuery($query);
0 ignored issues
show
Bug introduced by
Are you sure the usage of app('crud')->getQuery($query) targeting Backpack\CRUD\app\Librar...l\CrudPanel::getQuery() seems to always return null.

This check looks for function or method calls that always return null and whose return value is used.

class A
{
    function getObject()
    {
        return null;
    }

}

$a = new A();
if ($a->getObject()) {

The method getObject() can return nothing but null, so it makes no sense to use the return value.

The reason is most likely that a function or method is imcomplete or has been reduced for debug purposes.

Loading history...
Bug Best Practice introduced by
The expression return app('crud')->getQuery($query) returns the type void which is incompatible with the documented return type array.
Loading history...
20
        }
21
22
        $result = parent::runSelect();
23
        app('crud')->saveQuery($query, $result);
24
25
        return $result;
26
    }
27
}
28