Completed
Branch master (5f51e9)
by Michael
05:28 queued 02:42
created

PedigreeUtilities   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 20
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A prepareFolder() 0 9 2
1
<?php
2
3
/**
4
 * Created by PhpStorm.
5
 * User: Mamba
6
 * Date: 2014-11-19
7
 * Time: 3:05
8
 */
9
class PedigreeUtilities
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
10
{
11
12
    /**
13
     * Function responsible for checking if a directory exists, we can also write in and create an index.html file
14
     *
15
     * @param string $folder The full path of the directory to check
16
     *
17
     * @return void
18
     */
19
    public static function prepareFolder($folder)
20
    {
21
//        $filteredFolder = XoopsFilterInput::clean($folder, 'PATH');
0 ignored issues
show
Unused Code Comprehensibility introduced by
54% 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...
22
        if (!is_dir($folder)) {
23
            mkdir($folder);
24
            file_put_contents($folder . '/index.html', '<script>history.go(-1);</script>');
25
        }
26
//        chmod($filteredFolder, 0777);
0 ignored issues
show
Unused Code Comprehensibility introduced by
67% 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...
27
    }
28
}
29