Completed
Push — master ( 1d731f...7fdc08 )
by
unknown
10s
created

BasePageController::generatePDF()   D

Complexity

Conditions 12
Paths 145

Size

Total Lines 83
Code Lines 40

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 12
eloc 40
nc 145
nop 0
dl 0
loc 83
rs 4.6933
c 0
b 0
f 0

How to fix   Long Method    Complexity   

Long Method

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:

1
<?php
2
3
namespace CWP\CWP\PageTypes;
4
5
use SilverStripe\CMS\Controllers\ContentController;
6
use SilverStripe\ORM\FieldType\DBDatetime;
7
8
class BasePageController extends ContentController
9
{
10
    /**
11
     * Provide current year.
12
     */
13
    public function CurrentDatetime()
14
    {
15
        return DBDatetime::now();
16
    }
17
18
    public function getRSSLink()
19
    {
20
    }
21
}
22