Completed
Push — develop ( d6e54c...488d60 )
by Zack
17:10
created

GV_License_Handler::license_call()   D

Complexity

Conditions 18
Paths 312

Size

Total Lines 62
Code Lines 34

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 342

Importance

Changes 0
Metric Value
cc 18
eloc 34
nc 312
nop 1
dl 0
loc 62
ccs 0
cts 43
cp 0
crap 342
rs 4.537
c 0
b 0
f 0

How to fix   Long Method    Complexity   

Long Method

Small methods make your code easier to understand, in particular if combined with a good name. Besides, if your method is small, finding a good name is usually much easier.

For example, if you find yourself adding comments to a method's body, this is usually a good sign to extract the commented part to a new method, and use the comment as a starting point when coming up with a good name for this new method.

Commonly applied refactorings include:

1
<?php
0 ignored issues
show
Coding Style Compatibility introduced by
For compatibility and reusability of your code, PSR1 recommends that a file should introduce either new symbols (like classes, functions, etc.) or have side-effects (like outputting something, or including other files), but not both at the same time. The first symbol is defined on line 10 and the first side effect is on line 4.

The PSR-1: Basic Coding Standard recommends that a file should either introduce new symbols, that is classes, functions, constants or similar, or have side effects. Side effects are anything that executes logic, like for example printing output, changing ini settings or writing to a file.

The idea behind this recommendation is that merely auto-loading a class should not change the state of an application. It also promotes a cleaner style of programming and makes your code less prone to errors, because the logic is not spread out all over the place.

To learn more about the PSR-1, please see the PHP-FIG site on the PSR-1.

Loading history...
2
/** If this file is called directly, abort. */
3
if ( ! defined( 'GRAVITYVIEW_DIR' ) ) {
4
	die();
5
}
6
7
/**
8
 * @deprecated Use \GV\License_Handler instead.
9
 */
10
class GV_License_Handler extends \GV\License_Handler {
0 ignored issues
show
Coding Style introduced by
Since you have declared the constructor as private, maybe you should also declare the class as final.
Loading history...
11
	/**
12
	 * @param \GV\Addon_Settings $GFAddOn
0 ignored issues
show
Bug introduced by
There is no parameter named $GFAddOn. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
13
	 *
14
	 * @deprecated Use \GV\License_Handler::get instead
15
	 *
16
	 * @return GV\License_Handler
17
	 */
18
	public static function get_instance( $settings ) {
19
		gravityview()->log->warning( 'GV_License_Handler::get_instance() is deprated in favor of \GV\License_Handler::get()' );
20
		return \GV\License_Handler::get( $settings );
21
	}
22
}
23