Completed
Push — master ( 92e3a2...60e090 )
by Sebastian
02:03
created

PrepareCommitMsg   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 20
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 20
loc 20
ccs 6
cts 6
cp 1
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A configure() 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
/**
3
 * This file is part of CaptainHook.
4
 *
5
 * (c) Sebastian Feldmann <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
namespace CaptainHook\App\Console\Command\Hook;
11
12
use CaptainHook\App\Console\Command\Hook;
13
use CaptainHook\App\Hooks;
14
use Symfony\Component\Console\Input\InputArgument;
15
16
/**
17
 * Class PrepareCommitMessage
18
 *
19
 * @package CaptainHook
20
 * @author  Sebastian Feldmann <[email protected]>
21
 * @link    https://github.com/sebastianfeldmann/captainhook
22
 * @since   Class available since Release 3.1.0
23
 */
24 View Code Duplication
class PrepareCommitMsg extends Hook
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...
25
{
26
    /**
27
     * Hook to execute
28
     *
29
     * @var string
30
     */
31
    protected $name = Hooks::PREPARE_COMMIT_MSG;
32
33
    /**
34
     * Configure the command
35
     */
36 1
    protected function configure()
37
    {
38 1
        parent::configure();
39 1
        $this->addArgument('file', InputArgument::REQUIRED, 'File containing the commit log message');
40 1
        $this->addArgument('mode', InputArgument::OPTIONAL, 'Current commit mode');
41 1
        $this->addArgument('hash', InputArgument::OPTIONAL, 'Given commit hash');
42 1
    }
43
}
44