Completed
Push — master ( f8f77e...d2a4ab )
by Jason
05:01
created

DonationProduct   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 1
c 0
b 0
f 0
dl 0
loc 35
ccs 0
cts 5
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getCMSFields() 0 10 1
1
<?php
2
3
namespace Dynamic\FoxyStripe\Page;
4
5
use SilverStripe\Forms\FieldList;
6
7
class DonationProduct extends ProductPage
8
{
9
    /**
10
     * @var string
11
     */
12
    private static $singular_name = 'Donation';
0 ignored issues
show
introduced by
The private property $singular_name is not used, and could be removed.
Loading history...
13
14
    /**
15
     * @var string
16
     */
17
    private static $plural_name = 'Donations';
0 ignored issues
show
introduced by
The private property $plural_name is not used, and could be removed.
Loading history...
18
19
    /**
20
     * @var array
21
     */
22
    //private static $allowed_children = [];
0 ignored issues
show
Unused Code Comprehensibility introduced by
55% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
23
24
    /**
25
     * @var bool
26
     */
27
    private static $can_be_root = true;
0 ignored issues
show
introduced by
The private property $can_be_root is not used, and could be removed.
Loading history...
28
29
    /**
30
     * @return FieldList
31
     */
32
    public function getCMSFields()
33
    {
34
        $fields = parent::getCMSFields();
35
36
        $fields->removeByName([
37
            'Weight',
38
            'Price',
39
        ]);
40
41
        return $fields;
42
    }
43
}
44