Completed
Push — master ( a1059e...55b12e )
by Michael
01:29
created

Configurator   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 35
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 19 1
1
<?php namespace XoopsModules\Marquee\Common;
2
/*
3
 You may not change or alter any portion of this comment or credits
4
 of supporting developers from this source code or any supporting source code
5
 which is considered copyrighted (c) material of the original comment or credit authors.
6
7
 This program is distributed in the hope that it will be useful,
8
 but WITHOUT ANY WARRANTY; without even the implied warranty of
9
 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
10
 */
11
/**
12
 * Configurator Class
13
 *
14
 * @copyright   XOOPS Project (https://xoops.org)
15
 * @license     http://www.fsf.org/copyleft/gpl.html GNU public license
16
 * @author      XOOPS Development Team
17
 * @package     Publisher
18
 * @since       1.05
19
 *
20
 */
21
22
//require_once __DIR__ . '/../../include/common.php';
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
23
24
/**
25
 * Class Configurator
26
 */
27
class Configurator
28
{
29
    public $name;
30
    public $paths           = [];
31
    public $uploadFolders   = [];
32
    public $copyBlankFiles  = [];
33
    public $copyTestFolders = [];
34
    public $templateFolders = [];
35
    public $oldFiles        = [];
36
    public $oldFolders      = [];
37
    public $modCopyright;
38
39
    /**
40
     * Configurator constructor.
41
     */
42
    public function __construct()
43
    {
44
        $moduleDirName = basename(dirname(__DIR__));
45
        $capsDirName   = strtoupper($moduleDirName);
0 ignored issues
show
Unused Code introduced by
$capsDirName is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
46
47
        include_once __DIR__ . '/../../include/config.php';
48
        $config = getConfig();
49
50
        $this->name            = $config->name;
51
        $this->paths           = $config->paths;
52
        $this->uploadFolders   = $config->uploadFolders;
53
        $this->copyBlankFiles  = $config->copyBlankFiles;
54
        $this->copyTestFolders = $config->copyTestFolders;
55
        $this->templateFolders = $config->templateFolders;
56
        $this->oldFiles        = $config->oldFiles;
57
        $this->oldFolders      = $config->oldFolders;
58
        $this->modCopyright    = $config->modCopyright;
59
60
    }
61
}
62