Completed
Branch master (893650)
by Markus
04:08
created

index.php ➔ GetPackageList()   D

Complexity

Conditions 19
Paths 2

Size

Total Lines 47
Code Lines 36

Duplication

Lines 15
Ratio 31.91 %

Importance

Changes 0
Metric Value
cc 19
eloc 36
nc 2
nop 3
dl 15
loc 47
rs 4.8871
c 0
b 0
f 0

How to fix   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
2
3
if (!file_exists(__DIR__ . '/vendor/autoload.php')) {
4
    print('Autoloader not found! Did you follow the instructions from the INSTALL.md?<br />');
5
    print('(If you want to keep the old version, switch to the <tt>legacy</tt> branch by running: <tt>git checkout legacy</tt>');
6
    exit();
7
}
8
9
require_once __DIR__ . '/vendor/autoload.php';
10
11
use \SSpkS\Config;
12
use \SSpkS\Handler;
13
14
$config = new Config(__DIR__, 'conf/sspks.yaml');
15
$config->baseUrl = 'http' . ($_SERVER['HTTPS']?'s':'') . '://' . $_SERVER['HTTP_HOST'] . substr($_SERVER['REQUEST_URI'], 0, strrpos($_SERVER['REQUEST_URI'], '/')) . '/';
16
17
$handler = new Handler($config);
18
$handler->handle();
19