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

Completed
Pull Request — master (#18)
by Jérémiah
09:05
created

GraphController   A

Complexity

Total Complexity 5

Size/Duplication

Total Lines 33
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 4

Test Coverage

Coverage 100%

Importance

Changes 2
Bugs 0 Features 1
Metric Value
wmc 5
c 2
b 0
f 1
lcom 1
cbo 4
dl 0
loc 33
ccs 17
cts 17
cp 1
rs 10

3 Methods

Rating   Name   Duplication   Size   Complexity  
A endpointAction() 0 10 2
A treatBatchQuery() 0 11 2
A treatNormalQuery() 0 7 1
1
<?php
2
3
/*
4
 * This file is part of the OverblogGraphQLBundle package.
5
 *
6
 * (c) Overblog <http://github.com/overblog/>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace Overblog\GraphQLBundle\Controller;
13
14
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
15
use Symfony\Component\HttpFoundation\JsonResponse;
16
use Symfony\Component\HttpFoundation\Request;
17
18
class GraphController extends Controller
19
{
20 11
    public function endpointAction(Request $request)
21
    {
22 11
        if ($request->query->has('batch')) {
23 5
            $data = $this->treatBatchQuery($request);
24 1
        } else {
25 6
            $data = $this->treatNormalQuery($request);
26
        }
27
28 4
        return new JsonResponse($data, 200);
29
    }
30
31 5
    private function treatBatchQuery(Request $request)
32
    {
33 5
        $params = $this->get('overblog_graphql.request_batch_parser')->parse($request);
34 1
        $data = [];
35
36 1
        foreach ($params as $i => $entry) {
37 1
            $data[$i] = $this->get('overblog_graphql.request_executor')->execute($entry)->toArray();
38 1
        }
39
40 1
        return $data;
41
    }
42
43 6
    private function treatNormalQuery(Request $request)
44
    {
45 6
        $params = $this->get('overblog_graphql.request_parser')->parse($request);
46 3
        $data = $this->get('overblog_graphql.request_executor')->execute($params)->toArray();
47
48 3
        return $data;
49
    }
50
}
51