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.
Test Setup Failed
Branch master (290674)
by Marius
11:06
created

BaseObject   A

Complexity

Total Complexity 10

Size/Duplication

Total Lines 35
Duplicated Lines 60 %

Coupling/Cohesion

Components 0
Dependencies 3

Importance

Changes 0
Metric Value
dl 21
loc 35
rs 10
c 0
b 0
f 0
wmc 10
lcom 0
cbo 3

5 Methods

Rating   Name   Duplication   Size   Complexity  
A __call() 7 7 2
A __callStatic() 7 7 2
A __get() 7 7 2
A __set() 0 5 2
A isValid() 0 3 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
 * @package lib_infrastructure
4
 * @author marius orcsik <[email protected]>
5
 * @date 2010.03.30
6
 */
7
namespace vsc\infrastructure;
8
9
use vsc\ExceptionUnimplemented;
10
11
abstract class BaseObject {
12 View Code Duplication
	public function __call($sMethodName, $aVars) {
0 ignored issues
show
Duplication introduced by
This method 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...
13
		if (vsc::getEnv()->isDevelopment()) {
14
			throw new ExceptionUnimplemented('Method [' . get_class($this) . '::' . $sMethodName . '] not implemented for calling.');
15
		} else {
16
			return new Base();
17
		}
18
	}
19
20 View Code Duplication
	public static function __callStatic($sMethodName, $aVars) {
0 ignored issues
show
Duplication introduced by
This method 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...
21
		if (vsc::getEnv()->isDevelopment()) {
22
			throw new ExceptionUnimplemented('Method [' . get_class() . '::' . $sMethodName . '] not implemented for calling statically.');
23
		} else {
24
			return new Base();
25
		}
26
	}
27
28 View Code Duplication
	public function __get($sVarName) {
0 ignored issues
show
Duplication introduced by
This method 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...
29
		if (vsc::getEnv()->isDevelopment()) {
30
			throw new ExceptionUnimplemented('Property [' . get_class($this) . '::' . $sVarName . '] not implemented for reading.');
31
		} else {
32
			return new Base();
33
		}
34
	}
35
36
	public function __set($sVarName, $mValue) {
37
		if (vsc::getEnv()->isDevelopment()) {
38
			throw new ExceptionUnimplemented('Property [' . get_class($this) . '::' . $sVarName . '] not implemented for writing.');
39
		}
40
	}
41
42
	public static function isValid($oIncomingObject) {
43
		return (!is_null($oIncomingObject) && ($oIncomingObject instanceof static));
44
	}
45
}
46