NotFoundException   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 22
Duplicated Lines 100 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 7 7 2

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
 * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
4
 * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
5
 *
6
 * Licensed under The MIT License
7
 * Redistributions of files must retain the above copyright notice.
8
 *
9
 * @copyright     Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
10
 * @since         3.0.0
11
 * @license       https://opensource.org/licenses/mit-license.php MIT License
12
 */
13
namespace Cake\Http\Exception;
14
15
/**
16
 * Represents an HTTP 404 error.
17
 */
18 View Code Duplication
class NotFoundException extends HttpException
19
{
20
    /**
21
     * {@inheritDoc}
22
     */
23
    protected $_defaultCode = 404;
24
25
    /**
26
     * Constructor
27
     *
28
     * @param string|null $message If no message is given 'Not Found' will be the message
29
     * @param int $code Status code, defaults to 404
30
     * @param \Exception|null $previous The previous exception.
31
     */
32
    public function __construct($message = null, $code = null, $previous = null)
33
    {
34
        if (empty($message)) {
35
            $message = 'Not Found';
36
        }
37
        parent::__construct($message, $code, $previous);
38
    }
39
}
40