| Conditions | 1 |
| Paths | 1 |
| Total Lines | 18 |
| Code Lines | 7 |
| Lines | 18 |
| Ratio | 100 % |
| Tests | 8 |
| CRAP Score | 1 |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | 1 | public function main() |
|
| 23 | { |
||
| 24 | 1 | global $phpbb_container; |
|
|
1 ignored issue
–
show
|
|||
| 25 | |||
| 26 | /** @var \phpbb\ads\controller\ucp_controller $ucp_controller */ |
||
| 27 | 1 | $ucp_controller = $phpbb_container->get('phpbb.ads.ucp.controller'); |
|
| 28 | |||
| 29 | // Make the $u_action url available in the UCP controller |
||
| 30 | 1 | $ucp_controller->set_page_url($this->u_action); |
|
| 31 | |||
| 32 | // Load a template |
||
| 33 | 1 | $this->tpl_name = 'ucp_ads_stats'; |
|
| 34 | |||
| 35 | // Set the page title for our UCP page |
||
| 36 | 1 | $this->page_title = $ucp_controller->get_page_title(); |
|
| 37 | |||
| 38 | 1 | $ucp_controller->main(); |
|
| 39 | 1 | } |
|
| 40 | } |
||
| 41 |
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.