Sample3   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 30
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A play() 13 13 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
 * Sample3
4
 *
5
 * Sample画面を実現するためのクラス
6
 *
7
 * @package           risoluto
8
 * @author            Risoluto Developers
9
 * @license           http://opensource.org/licenses/bsd-license.php new BSD license
10
 * @copyright     (C) 2008-2015 Risoluto Developers / All Rights Reserved.
11
 */
12
13
//------------------------------------------------------//
14
// 名前空間の定義
15
//------------------------------------------------------//
16
namespace RisolutoApps\Sample;
17
18
//------------------------------------------------------//
19
// クラス定義
20
//------------------------------------------------------//
21 View Code Duplication
class Sample3 extends \Risoluto\RisolutoControllerBase implements \Risoluto\RisolutoControllerInterface
22
{
23
    // View関連の処理を使用する
24
    use \Risoluto\RisolutoViewTrait;
25
26
    /**
27
     * play()
28
     *
29
     * 主処理を行う
30
     *
31
     * @access    public
32
     *
33
     * @param     void
34
     *
35
     * @return    void    なし
36
     */
37
    public function play()
38
    {
39
        // ユーザ定義のライブラリコール例
40
        \RisolutoUserLibs\SampleLibs::sampleMethod();
41
42
        // ヘッダ情報のセット
43
        $header = $this->getDefaultHeader();
44
        $header = $this->replaceHeader( $header, 'robots', 'NOINDEX,NOFOLLOW' );
45
46
        // テンプレートエンジン関連の処理
47
        $assign_value = [ 'header' => $header ];
48
        $this->risolutoView( $assign_value );
49
    }
50
}