GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( a42b47...a111ac )
by Florian
03:12
created

Car   A

Complexity

Total Complexity 4

Size/Duplication

Total Lines 36
Duplicated Lines 100 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

Changes 1
Bugs 1 Features 1
Metric Value
c 1
b 1
f 1
dl 36
loc 36
wmc 4
lcom 1
cbo 1
rs 10

4 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 4 4 1
A getTitle() 3 3 1
A getYearOfProduction() 3 3 1
A indexEntity() 4 4 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
/*
4
 * This file is part of the Stinger Enity Search package.
5
 *
6
 * (c) Oliver Kotte <[email protected]>
7
 * (c) Florian Meyer <[email protected]>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
namespace StingerSoft\EntitySearchBundle\Tests\Fixtures\ORM;
13
14
use Doctrine\ORM\Mapping as ORM;
15
use StingerSoft\EntitySearchBundle\Model\SearchableEntity;
16
use StingerSoft\EntitySearchBundle\Model\Document;
17
18
/**
19
 * @ORM\Entity
20
 */
21 View Code Duplication
class Car implements SearchableEntity {
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...
22
23
	/**
24
	 * @ORM\Id @ORM\Column(type="string")
25
	 */
26
	private $title;
27
28
	/**
29
	 * @ORM\Id @ORM\Column(type="integer")
30
	 */
31
	private $year;
32
33
	public function __construct($title, $year) {
34
		$this->title = $title;
35
		$this->year = $year;
36
	}
37
38
	public function getTitle() {
39
		return $this->title;
40
	}
41
42
	public function getYearOfProduction() {
43
		return $this->year;
44
	}
45
46
	/**
47
	 *
48
	 * {@inheritDoc}
49
	 *
50
	 * @see \StingerSoft\EntitySearchBundle\Model\SearchableEntity::indexEntity()
51
	 */
52
	public function indexEntity(Document &$document) {
53
		$document->addField(Document::FIELD_TITLE, $this->getTitle());
54
		return self::$index;
55
	}
56
}