Conditions | 11 |
Paths | 1024 |
Total Lines | 31 |
Code Lines | 20 |
Lines | 0 |
Ratio | 0 % |
Changes | 0 |
Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.
For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.
Commonly applied refactorings include:
If many parameters/temporary variables are present:
1 | <?php |
||
26 | public function __construct($name, $action, $con, $cached=false) |
||
27 | { |
||
28 | if ($name=="CodeForces") { |
||
29 | $crawler=new CodeForces($action, $con, $cached); |
||
30 | } |
||
31 | if ($name=="ContestHunter") { |
||
32 | $crawler=new ContestHunter($action, $con, $cached); |
||
33 | } |
||
34 | if ($name=="POJ") { |
||
35 | $crawler=new POJ($action, $con, $cached); |
||
36 | } |
||
37 | if ($name=="PTA") { |
||
38 | $crawler=new PTA($action, $con, $cached); |
||
39 | } |
||
40 | if ($name=="Vijos") { |
||
41 | $crawler=new Vijos($action, $con, $cached); |
||
42 | } |
||
43 | if ($name=="UVa") { |
||
44 | $crawler=new UVa($action, $con, $cached); |
||
45 | } |
||
46 | if ($name=="UVaLive") { |
||
47 | $crawler=new UVaLive($action, $con, $cached); |
||
48 | } |
||
49 | if ($name=="HDU") { |
||
50 | $crawler=new HDU($action, $con, $cached); |
||
51 | } |
||
52 | if ($name=="SPOJ") { |
||
53 | $crawler=new SPOJ($action, $con, $cached); |
||
54 | } |
||
55 | if (isset($crawler)) { |
||
56 | $this->data=$crawler->data; |
||
57 | } |
||
60 |