Passed
Push — main ( 106d28...df360d )
by PRATIK
13:25
created

TopExitPages   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 10
c 1
b 0
f 0
dl 0
loc 17
rs 10
wmc 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A render() 0 13 1
1
<?php
2
3
namespace Adminetic\Website\Http\Livewire\Admin\Analytics;
4
5
use Analytics;
0 ignored issues
show
Bug introduced by
The type Analytics 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...
6
use Spatie\Analytics\Period;
7
use Livewire\Component;
0 ignored issues
show
Bug introduced by
The type Livewire\Component 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...
8
9
class TopExitPages extends Component
10
{
11
    public $days = 3;
12
13
    public function render()
14
    {
15
        $top_exit_pages = Analytics::performQuery(
16
            Period::days($this->days),
17
            'ga:pageviews',
18
            [
19
                'dimensions' => 'ga:exitPagePath',
20
                'metrics' => 'ga:exits,ga:pageviews',
21
                'sort' => '-ga:exits'
22
            ]
23
        )->rows;
24
25
        return view('website::livewire.admin.analytics.top-exit-pages', compact('top_exit_pages'));
26
    }
27
}
28