Controller   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 19
Duplicated Lines 47.37 %

Coupling/Cohesion

Components 0
Dependencies 2

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 2
dl 9
loc 19
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A createWepayAccount() 9 9 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
3
namespace App\Containers\Wepay\UI\API\Controllers;
4
5
use Apiato\Core\Foundation\Facades\Apiato;
6
use App\Containers\Wepay\UI\API\Requests\CreateWepayAccountRequest;
7
use App\Ship\Parents\Controllers\ApiController;
8
use App\Ship\Transporters\DataTransporter;
9
10
/**
11
 * Class Controller.
12
 *
13
 * @author Rockers Technologies <[email protected]>
14
 */
15
class Controller extends ApiController
16
{
17
18
    /**
19
     * @param \App\Containers\Wepay\UI\API\Requests\CreateWepayAccountRequest $request
20
     *
21
     * @return  \Illuminate\Http\JsonResponse
22
     */
23 View Code Duplication
    public function createWepayAccount(CreateWepayAccountRequest $request)
0 ignored issues
show
Duplication introduced by Jaimin Suthar
This method 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...
24
    {
25
        $wepayAccount = Apiato::call('[email protected]', [new DataTransporter($request)]);
26
27
        return $this->accepted([
28
            'message'        => 'Wepay account created successfully.',
29
            'wepayAccountId' => $wepayAccount->id,
30
        ]);
31
    }
32
33
}
34