| Conditions | 4 |
| Paths | 8 |
| Total Lines | 33 |
| Code Lines | 26 |
| Lines | 16 |
| Ratio | 48.48 % |
| Tests | 30 |
| CRAP Score | 4 |
| 1 | <?php |
||
| 26 | 1 | public function requireDefaultRecords() { |
|
| 27 | 1 | parent::requireDefaultRecords(); |
|
| 28 | |||
| 29 | 1 | $similar = AutoCompleteOption::get()->filter('Name', 'Similar')->first(); |
|
|
1 ignored issue
–
show
|
|||
| 30 | 1 | if (!$similar) { |
|
| 31 | 1 | $similar = new AutoCompleteOption(); |
|
| 32 | 1 | $similar->Name = 'Similar'; |
|
|
1 ignored issue
–
show
|
|||
| 33 | 1 | $similar->Slug = 'SIMILAR'; |
|
|
1 ignored issue
–
show
|
|||
| 34 | 1 | $similar->Description = 'Find records similar to the selected item'; |
|
| 35 | 1 | $similar->Locale = i18n::default_locale(); |
|
| 36 | 1 | $similar->write(); |
|
| 37 | 1 | } |
|
| 38 | |||
| 39 | 1 | $search = AutoCompleteOption::get()->filter('Name', 'Search')->first(); |
|
|
1 ignored issue
–
show
|
|||
| 40 | 1 | View Code Duplication | if (!$search) { |
| 41 | 1 | $search = new AutoCompleteOption(); |
|
| 42 | 1 | $search->Name = 'Search'; |
|
| 43 | 1 | $search->Description = 'Find records similar to the selected item'; |
|
| 44 | 1 | $search->Slug = 'SEARCH'; |
|
| 45 | 1 | $search->Locale = i18n::default_locale(); |
|
| 46 | 1 | $search->write(); |
|
| 47 | 1 | } |
|
| 48 | |||
| 49 | 1 | $goto = AutoCompleteOption::get()->filter('Name', 'GoToRecord')->first(); |
|
|
1 ignored issue
–
show
|
|||
| 50 | 1 | View Code Duplication | if (!$goto) { |
| 51 | 1 | $goto = new AutoCompleteOption(); |
|
| 52 | 1 | $goto->Name = 'GoToRecord'; |
|
|
1 ignored issue
–
show
|
|||
| 53 | 1 | $goto->Description = 'Go to the page of the selected item, found by the Link() method'; |
|
|
1 ignored issue
–
show
|
|||
| 54 | 1 | $goto->Locale = i18n::default_locale(); |
|
|
1 ignored issue
–
show
|
|||
| 55 | 1 | $goto->Slug = 'GOTO'; |
|
| 56 | 1 | $goto->write(); |
|
| 57 | 1 | } |
|
| 58 | 1 | } |
|
| 59 | } |
||
| 60 |
This check marks private properties in classes that are never used. Those properties can be removed.