GoogleAPISiteConfigExtension   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
dl 0
loc 25
rs 10
c 0
b 0
f 0
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A updateCMSFields() 0 6 1
1
<?php
2
3
4
/**
5
 * Class GoogleAPISiteConfigExtension
6
 *
7
 * @property SiteConfig|GoogleAPISiteConfigExtension $owner
8
 * @property string $Viewid
9
 * @property string $DateRange
10
 * @property string $Metric
11
 */
12
class GoogleAPISiteConfigExtension extends DataExtension
0 ignored issues
show
Bug introduced by
The type DataExtension was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
13
{
14
    private static $db = [
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...
15
        'Viewid'    => 'Varchar(50)',
16
        'DateRange' => 'Enum("7,30,60,90")',
17
        'Metric' => 'Enum("ga:pageviews")'
18
    ];
19
20
    protected static $date_range = [
21
        7  => '7 Days',
22
        30 => '30 Days',
23
        60 => '60 Days',
24
        90 => '90 Days'
25
    ];
26
27
    protected static $metrics = [
28
        'ga:pageviews' => 'Pageviews',
29
    ];
30
31
    public function updateCMSFields(FieldList $fields)
0 ignored issues
show
Bug introduced by
The type FieldList was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
32
    {
33
        $fields->addFieldsToTab('Root.GoogleAPI', [
34
            TextField::create('Viewid', 'View ID from Analytics'),
0 ignored issues
show
Bug introduced by
The type TextField was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
35
            DropdownField::create('DateRange', 'Amount of days to get', static::$date_range),
0 ignored issues
show
Bug introduced by
The type DropdownField was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
36
            DropdownField::create('Metric', 'Metrics', static::$metrics)
37
        ]);
38
    }
39
}
40