Head   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 11
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 6
Bugs 1 Features 0
Metric Value
wmc 1
c 6
b 1
f 0
lcom 0
cbo 2
dl 11
loc 11
ccs 0
cts 6
cp 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A prepare() 8 8 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 the bee4/transport package.
4
 * For the full copyright and license information, please view the LICENSE
5
 * file that was distributed with this source code.
6
 *
7
 * @copyright Bee4 2015
8
 * @author  Stephane HULARD <[email protected]>
9
 * @package Bee4\Transport\Message\Request\Ftp
10
 */
11
12
namespace Bee4\Transport\Message\Request\Ftp;
13
14
/**
15
 * FTP HEAD Request object used to check if resources are really here
16
 * @package Bee4\Transport\Message\Request\Ftp
17
 */
18 View Code Duplication
class Head extends FtpRequest
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...
19
{
20
    protected function prepare()
21
    {
22
        parent::prepare();
23
24
        $this->addOption(CURLOPT_NOBODY, true);
25
        //apply MDTM action on the file, if not valid status is 550 the simplest way for HEAD
26
        $this->addOption(CURLOPT_QUOTE, ['MDTM '.$this->getUrl()->path()]);
27
    }
28
}
29