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

ReportingServiceProvider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 30
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A register() 9 9 1
A registerNamespaces() 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 App;
5
use Config;
6
use Lang;
7
use View;
8
use Illuminate\Support\ServiceProvider;
9
10 View Code Duplication
class ReportingServiceProvider 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...
11
{
12
	/**
13
	 * Register the Reporting module service provider.
14
	 *
15
	 * @return void
16
	 */
17
	public function register()
18
	{
19
		// This service provider is a convenient place to register your modules
20
		// services in the IoC container. If you wish, you may make additional
21
		// methods or service providers to keep the code more focused and granular.
22
		App::register('App\Modules\Reporting\Providers\RouteServiceProvider');
23
24
		$this->registerNamespaces();
25
	}
26
27
	/**
28
	 * Register the Reporting module resource namespaces.
29
	 *
30
	 * @return void
31
	 */
32
	protected function registerNamespaces()
33
	{
34
		Lang::addNamespace('reports', realpath(__DIR__.'/../Resources/Lang'));
35
		
36
		View::addNamespace('reports', base_path('resources/views/vendor/reports'));
37
		View::addNamespace('reports', realpath(__DIR__.'/../Resources/Views'));
38
	}
39
}
40