| Conditions | 1 |
| Paths | 1 |
| Total Lines | 70 |
| Code Lines | 57 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 57 |
| CRAP Score | 1 |
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 |
||
| 38 | 1 | public static function get_field_data() { |
|
| 39 | return array( |
||
| 40 | 'glue' => array( |
||
| 41 | 1 | 'type' => 'text', |
|
| 42 | 1 | 'title' => __( 'Glue', 'carbon_breadcrumbs' ), |
|
| 43 | 1 | 'default' => ' > ', |
|
| 44 | 1 | 'help' => __( 'This is displayed between the breadcrumb items.', 'carbon_breadcrumbs' ), |
|
| 45 | 1 | ), |
|
| 46 | 'link_before' => array( |
||
| 47 | 1 | 'type' => 'text', |
|
| 48 | 1 | 'title' => __( 'Link Before', 'carbon_breadcrumbs' ), |
|
| 49 | 1 | 'default' => '', |
|
| 50 | 1 | 'help' => __( 'This is displayed before the breadcrumb item link.', 'carbon_breadcrumbs' ), |
|
| 51 | 1 | ), |
|
| 52 | 'link_after' => array( |
||
| 53 | 1 | 'type' => 'text', |
|
| 54 | 1 | 'title' => __( 'Link After', 'carbon_breadcrumbs' ), |
|
| 55 | 1 | 'default' => '', |
|
| 56 | 1 | 'help' => __( 'This is displayed after the breadcrumb item link.', 'carbon_breadcrumbs' ), |
|
| 57 | 1 | ), |
|
| 58 | 'wrapper_before' => array( |
||
| 59 | 1 | 'type' => 'text', |
|
| 60 | 1 | 'title' => __( 'Wrapper Before', 'carbon_breadcrumbs' ), |
|
| 61 | 1 | 'default' => '', |
|
| 62 | 1 | 'help' => __( 'This is displayed before displaying the breadcrumb items.', 'carbon_breadcrumbs' ), |
|
| 63 | 1 | ), |
|
| 64 | 'wrapper_after' => array( |
||
| 65 | 1 | 'type' => 'text', |
|
| 66 | 1 | 'title' => __( 'Wrapper After', 'carbon_breadcrumbs' ), |
|
| 67 | 1 | 'default' => '', |
|
| 68 | 1 | 'help' => __( 'This is displayed after displaying the breadcrumb items.', 'carbon_breadcrumbs' ), |
|
| 69 | 1 | ), |
|
| 70 | 'title_before' => array( |
||
| 71 | 1 | 'type' => 'text', |
|
| 72 | 1 | 'title' => __( 'Title Before', 'carbon_breadcrumbs' ), |
|
| 73 | 1 | 'default' => '', |
|
| 74 | 1 | 'help' => __( 'This is displayed before the breadcrumb item title.', 'carbon_breadcrumbs' ), |
|
| 75 | 1 | ), |
|
| 76 | 'title_after' => array( |
||
| 77 | 1 | 'type' => 'text', |
|
| 78 | 1 | 'title' => __( 'Title After', 'carbon_breadcrumbs' ), |
|
| 79 | 1 | 'default' => '', |
|
| 80 | 1 | 'help' => __( 'This is displayed after the breadcrumb item title.', 'carbon_breadcrumbs' ), |
|
| 81 | 1 | ), |
|
| 82 | 'min_items' => array( |
||
| 83 | 1 | 'type' => 'text', |
|
| 84 | 1 | 'title' => __( 'Min Items', 'carbon_breadcrumbs' ), |
|
| 85 | 1 | 'default' => 2, |
|
| 86 | 1 | 'help' => __( 'Determines the minimum number of items, required to display the breadcrumb trail.', 'carbon_breadcrumbs' ), |
|
| 87 | 1 | ), |
|
| 88 | 'last_item_link' => array( |
||
| 89 | 1 | 'type' => 'checkbox', |
|
| 90 | 1 | 'title' => __( 'Last Item Link', 'carbon_breadcrumbs' ), |
|
| 91 | 1 | 'default' => true, |
|
| 92 | 1 | 'help' => __( 'Whether the last breadcrumb item should be a link.', 'carbon_breadcrumbs' ), |
|
| 93 | 1 | ), |
|
| 94 | 'display_home_item' => array( |
||
| 95 | 1 | 'type' => 'checkbox', |
|
| 96 | 1 | 'title' => __( 'Display Home Item?', 'carbon_breadcrumbs' ), |
|
| 97 | 1 | 'default' => true, |
|
| 98 | 1 | 'help' => __( 'Whether the home breadcrumb item should be displayed.', 'carbon_breadcrumbs' ), |
|
| 99 | 1 | ), |
|
| 100 | 'home_item_title' => array( |
||
| 101 | 1 | 'type' => 'text', |
|
| 102 | 1 | 'title' => __( 'Home Item Title', 'carbon_breadcrumbs' ), |
|
| 103 | 1 | 'default' => __( 'Home', 'carbon_breadcrumbs' ), |
|
| 104 | 1 | 'help' => __( 'Determines the title of the home item.', 'carbon_breadcrumbs' ), |
|
| 105 | 1 | ), |
|
| 106 | 1 | ); |
|
| 107 | } |
||
| 108 | |||
| 193 | } |