PiwikSiteConfigExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 4

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 9 1
1
<?php
2
3
/**
4
 * Created by IntelliJ IDEA.
5
 * User: Werner M. Krauß <[email protected]>
6
 * Date: 16.03.2016
7
 * Time: 08:53
8
 */
9
class PiwikSiteConfigExtension extends DataExtension
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
    private static $db = array(
0 ignored issues
show
Unused Code introduced by
The property $db is not used and could be removed.

This check marks private properties in classes that are never used. Those properties can be removed.

Loading history...
12
        'PiwikSiteID' => 'Int'
13
    );
14
15
    public function updateCMSFields(FieldList $fields)
16
    {
17
        $fields->addFieldToTab('Root.Piwik', HeaderField::create('Piwik'));
18
19
        $siteIDField = NumericField::create('PiwikSiteID', _t('PiwikSiteConfigExtension.db_PiwikSiteID', 'PIWIK Site ID'))
20
            ->setDescription(_t('PiwikSiteConfigExtension.SiteIDDescription', 'The ID of this site, can be found in the generated PIWIK tracking code'));
21
22
        $fields->addFieldToTab('Root.Piwik', $siteIDField);
23
    }
24
}
25