Passed
Push — master ( ec2c00...5a182f )
by Владислав
46s queued 10s
created

TwoCaptchaFunCaptcha   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A init() 20 20 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 jumper423\decaptcha\services;
4
5
/**
6
 * Class TwoCaptchaFunCaptcha.
7
 */
8 View Code Duplication
class TwoCaptchaFunCaptcha extends RuCaptchaFunCaptcha
9
{
10
    protected $host = '2captcha.com';
11
12
    public function init()
13
    {
14
        parent::init();
15
16
        $this->wiki->setText(['service', 'name'], [
17
            'ru' => '2Captcha FunCaptcha',
18
            'en' => '2Captcha FunCaptcha',
19
        ]);
20
        $this->wiki->setText(['service', 'href'], 'http://infoblog1.ru/goto/2captcha');
21
        $this->wiki->setText(['menu', 'from_service'], [
22
            TwoCaptcha::class,
23
            TwoCaptchaInstruction::class,
24
            TwoCaptchaClick::class,
25
            TwoCaptchaGrid::class,
26
            TwoCaptchaReCaptcha::class,
27
            TwoCaptchaFunCaptcha::class,
28
            TwoCaptchaReCaptchaV3::class,
29
            TwoCaptchaGeeTest::class,
30
        ]);
31
    }
32
}
33