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

CampaignController   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 71.43%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 3
dl 0
loc 35
ccs 5
cts 7
cp 0.7143
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A index() 0 4 1
A show() 0 6 1
1
<?php
2
3
namespace DoeSangue\Http\Controllers\API\V1;
4
5
use DoeSangue\Http\Controllers\Controller;
6
use DoeSangue\Models\Campaign;
7
use DoeSangue\Http\Resources\Campaign as CampaignResource;
8
use DoeSangue\Http\Resources\CampaignCollection;
9
10
11
class CampaignController extends Controller
12
{
13
    /**
14
     * Initialize the class
15
     * and set the middleware
16
     */
17 1
    public function __construct()
18
    {
19 1
        $this->middleware('jwt.auth', [ 'except' => [ 'index', 'show' ] ]);
20 1
    }
21
22
    /**
23
     * Get all campaigns
24
     * 20 queries per page
25
     *
26
     * @return CampaignCollection
27
     */
28 1
    public function index()
29
    {
30 1
        return new CampaignCollection(Campaign::paginate(30));
31
    }
32
33
    /**
34
     * Get all details of a campaign
35
     *
36
     * @return CampaignResource
37
     */
38
    public function show($campaign)
39
    {
40
41
        return new CampaignResource(Campaign::find($campaign));
42
43
    }
44
45
}
46