Passed
Pull Request — master (#53)
by
unknown
05:24
created

ScoreSheetController   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 26
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 15
dl 0
loc 26
ccs 0
cts 16
cp 0
rs 10
c 1
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A index() 0 20 1
1
<?php
2
3
namespace App\Http\Controllers;
4
5
use App\Tournament;
6
7
class ScoreSheetController extends Controller
8
{
9
    /**
10
     * @param $tournamentSlug
11
     * @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View
12
     */
13
    public function index($tournamentSlug)
14
    {
15
        $tournament = Tournament::with(
16
            'championships.category',
17
//            'championships.teams',
18
//            'championships.competitors',
19
            'championships.settings',
20
            'championships.fightersGroups.championship.category', // TODO This is not good
21
            'championships.fightersGroups.teams',
22
            'championships.fightersGroups.competitors',
23
            'championships.fightersGroups.fights.group.championship.category', // TODO This is not good
24
            'championships.fightersGroups.fights.competitor1',
25
            'championships.fightersGroups.fights.competitor2',
26
            'championships.fightersGroups.fights.team1',
27
            'championships.fightersGroups.fights.team2'
28
29
        )->where('slug', $tournamentSlug)->first();
30
31
        $sheet = null;
32
        return view('scoresheets.index', compact('tournament', 'sheet'));
33
    }
34
}
35