StockistsCountryReports_WithoutCountry::sort()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4

Duplication

Lines 4
Ratio 100 %

Importance

Changes 0
Metric Value
dl 4
loc 4
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 0
1
<?php
2
3
/**
4
 *
5
 * @authors: Nicolaas [at] Sunny Side Up .co.nz
6
 * @sub-package: reports
7
 * @inspiration: Silverstripe Ltd, Jeremy
8
 **/
9
10 View Code Duplication
class StockistsCountryReports_WithoutCountry extends SS_Report
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
13
    /**
14
     * The class of object being managed by this report.
15
     * Set by overriding in your subclass.
16
     */
17
    protected $dataClass = 'StockistCountryPage';
18
19
    /**
20
     *
21
     * @return String
22
     */
23
    public function title()
24
    {
25
        return "STOCKISTS: stockist countries without a country (".$this->sourceRecords()->count().")";
26
    }
27
28
    /**
29
     * not sure if this is used in SS3
30
     * @return String
31
     */
32
    public function group()
33
    {
34
        return "Stockists";
35
    }
36
37
    /**
38
     *
39
     * @return INT - for sorting reports
40
     */
41
    public function sort()
42
    {
43
        return 9000;
44
    }
45
46
    /**
47
     * working out the items
48
     * @return DataList
49
     */
50
    public function sourceRecords($params = null)
0 ignored issues
show
Unused Code introduced by
The parameter $params is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
51
    {
52
        return StockistCountryPage::get()->where("Country = '' OR Country IS NULL");
53
    }
54
55
    /**
56
     * @return Array
57
     */
58
    public function columns()
59
    {
60
        return array(
61
            "Title" => array(
62
                "title" => "FullName",
63
                "link" => true
64
            )
65
        );
66
    }
67
68
    /**
69
     *
70
     * @return FieldList
71
     */
72
    public function getParameterFields()
73
    {
74
        return new FieldList();
75
    }
76
}
77