Passed
Push — master ( 609799...41987d )
by John
04:18
created

Crawler   A

Complexity

Total Complexity 8

Size/Duplication

Total Lines 30
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
eloc 15
dl 0
loc 30
rs 10
c 0
b 0
f 0
wmc 8

1 Method

Rating   Name   Duplication   Size   Complexity  
B __construct() 0 21 8
1
<?php
2
3
namespace App\Babel\Crawler;
4
5
use App\Http\Controllers\VirtualCrawler\CodeForces\CodeForces;
6
use App\Http\Controllers\VirtualCrawler\ContestHunter\ContestHunter;
7
use App\Http\Controllers\VirtualCrawler\POJ\POJ;
8
use App\Http\Controllers\VirtualCrawler\PTA\PTA;
9
use App\Http\Controllers\VirtualCrawler\Vijos\Vijos;
10
use App\Http\Controllers\VirtualCrawler\UVa\UVa;
11
use App\Models\ProblemModel;
12
use Auth;
13
14
class Crawler
15
{
16
    public $data = null;
17
18
    /**
19
     * Initial
20
     *
21
     * @return Response
0 ignored issues
show
Bug introduced by
The type App\Babel\Crawler\Response was not found. Did you mean Response? If so, make sure to prefix the type with \.
Loading history...
22
     */
23
    public function __construct($name, $action, $con, $cached=false)
24
    {
25
        if ($name=="CodeForces") {
26
            $crawler = new CodeForces($action, $con, $cached);
27
        }
28
        if ($name=="ContestHunter") {
29
            $crawler = new ContestHunter($action, $con, $cached);
30
        }
31
        if ($name=="POJ") {
32
            $crawler = new POJ($action, $con, $cached);
33
        }
34
        if ($name=="PTA") {
35
            $crawler = new PTA($action, $con, $cached);
36
        }
37
        if ($name=="Vijos") {
38
            $crawler = new Vijos($action, $con, $cached);
39
        }
40
        if ($name=="UVa") {
41
            $crawler = new UVa($action, $con, $cached);
42
        }
43
        if (isset($crawler)) $this->data = $crawler->data;
44
    }
45
}
46