Completed
Push — master ( c7d5ad...0208a8 )
by Sherif
02:59
created

RouteServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 1
cbo 2
dl 38
loc 38
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A boot() 6 6 1
A map() 7 7 1

How to fix   Duplicated Code   

Duplicated Code

Duplicate code is one of the most pungent code smells. A rule that is often used is to re-structure code once it is duplicated in three or more places.

Common duplication problems, and corresponding solutions are:

1
<?php
2
namespace App\Modules\Reporting\Providers;
3
4
use Caffeinated\Modules\Providers\RouteServiceProvider as ServiceProvider;
5
use Illuminate\Routing\Router;
6
7 View Code Duplication
class RouteServiceProvider extends ServiceProvider
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...
8
{
9
	/**
10
	 * This namespace is applied to the controller routes in your module's routes file.
11
	 *
12
	 * In addition, it is set as the URL generator's root namespace.
13
	 *
14
	 * @var string
15
	 */
16
	protected $namespace = 'App\Modules\Reporting\Http\Controllers';
17
18
	/**
19
	 * Define your module's route model bindings, pattern filters, etc.
20
	 *
21
	 * @param  \Illuminate\Routing\Router $router
22
	 * @return void
23
	 */
24
	public function boot(Router $router)
25
	{
26
		parent::boot($router);
27
28
		//
29
	}
30
31
	/**
32
	 * Define the routes for the module.
33
	 *
34
	 * @param  \Illuminate\Routing\Router $router
35
	 * @return void
36
	 */
37
	public function map(Router $router)
38
	{
39
		$router->group(['namespace' => $this->namespace], function($router)
40
		{
41
			require (config('modules.path').'/Reporting/Http/routes.php');
42
		});
43
	}
44
}
45