Scrutinizer GitHub App not installed

We could not synchronize checks via GitHub's checks API since Scrutinizer's GitHub App is not installed for this repository.

Install GitHub App

GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Passed
Branch master (5c2c02)
by Sebastian
02:31
created

plugins/pageview/tx_dlf_ol3.js   A

Complexity

Total Complexity 17
Complexity/F 1.7

Size

Lines of Code 123
Function Count 10

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 0
c 0
b 0
f 0
nc 8
dl 0
loc 123
rs 10
wmc 17
mnd 1
bc 14
fnc 10
bpm 1.4
cpm 1.7
noi 10

9 Functions

Rating   Name   Duplication   Size   Complexity  
A ol.Map.zoomOut 0 10 1
A ol.Map.rotate 0 15 2
A ol.Map.resetRotation 0 6 2
A ol.Map.rotateRight 0 6 2
A ol.Map.getZoomRange 0 4 3
A ol.Map.zoom 0 9 1
A ol.Map.zoomIn 0 10 1
A ol.Map.zoomTo 0 11 2
A ol.Map.rotateLeft 0 6 2
1
/**
2
 * (c) Kitodo. Key to digital objects e.V. <[email protected]>
3
 *
4
 * This file is part of the Kitodo and TYPO3 projects.
5
 *
6
 * @license GNU General Public License version 3 or later.
7
 * For the full copyright and license information, please read the
8
 * LICENSE.txt file that was distributed with this source code.
9
 */
10
11
/**
12
 * @return {number|undefined}
13
 */
14
ol.Map.prototype.getZoom = function(){
0 ignored issues
show
Bug introduced by
The variable ol seems to be never declared. If this is a global, consider adding a /** global: ol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
15
    return this.getView().getZoom();
16
};
17
18
/**
19
 * Returns an array containing the min and max zoom level [minZoom, maxZoom]
20
 * @return {Array.<number>}
21
 */
22
ol.Map.prototype.getZoomRange = function() {
0 ignored issues
show
Bug introduced by
The variable ol seems to be never declared. If this is a global, consider adding a /** global: ol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
23
    var maxZoom = window.OL3_MAX_ZOOM !== undefined && !isNaN(window.OL3_MAX_ZOOM) ? window.OL3_MAX_ZOOM : 18;
24
    return [0, maxZoom];
25
};
26
27
/**
28
 * Zooms to given zoomLevel
29
 * 
30
 * @param {number} zoomLevel
31
 */
32
ol.Map.prototype.zoom = function(zoomLevel) {
0 ignored issues
show
Bug introduced by
The variable ol seems to be never declared. If this is a global, consider adding a /** global: ol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
33
    var view = this.getView(),
34
    	resolution = view.getResolution();
35
	this.beforeRender(ol.animation.zoom({
0 ignored issues
show
Bug introduced by
The variable ol seems to be never declared. If this is a global, consider adding a /** global: ol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
36
	    'resolution': resolution,
37
	    'duration': 500
38
	}));
39
	view.setZoom(zoomLevel);
40
};
41
42
/**
43
 * Zooms in the map. Uses ol.animation for smooth zooming
44
 */
45
ol.Map.prototype.zoomIn = function() {
46
    var view = this.getView(),
47
        zoomLevel = view.getZoom() + 1,
48
        resolution = view.getResolution();
49
    this.beforeRender(ol.animation.zoom({
0 ignored issues
show
Bug introduced by
The variable ol seems to be never declared. If this is a global, consider adding a /** global: ol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
50
        'resolution': resolution,
51
        'duration': 500
52
    }));
53
    view.setZoom(zoomLevel);
54
};
55
56
/**
57
 * Zooms out the map
58
 */
59
ol.Map.prototype.zoomOut = function() {
60
    var view = this.getView(),
61
        zoomLevel = view.getZoom() - 1,
62
     resolution = view.getResolution();
63
    this.beforeRender(ol.animation.zoom({
0 ignored issues
show
Bug introduced by
The variable ol seems to be never declared. If this is a global, consider adding a /** global: ol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
64
        'resolution': resolution,
65
        'duration': 500
66
    }));
67
    view.setZoom(zoomLevel);
68
};
69
70
/**
71
 * Zooms to given point
72
 * @param {Array.<number>} center
73
 * @param {number} zoomLevel
74
 * @param {number=} opt_duration
75
 */
76
ol.Map.prototype.zoomTo = function(center, zoomLevel, opt_duration) {
77
    var view = this.getView(),
78
        resolution = view.getResolution(),
79
        duration = opt_duration !== undefined ? opt_duration : 500;
80
    this.beforeRender(ol.animation.zoom({
0 ignored issues
show
Bug introduced by
The variable ol seems to be never declared. If this is a global, consider adding a /** global: ol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
81
        'resolution': resolution,
82
        'duration': duration
83
    }));
84
    view.setCenter(center);
85
    view.setZoom(zoomLevel);
86
};
87
88
/**
89
 * Rotate the map
90
 * @param {number} rotation
91
 */
92
ol.Map.prototype.rotate = function(rotation) {
93
    var view = this.getView(),
94
        rotate = view.getRotation() + (rotation *  Math.PI/180),
95
        center = view.getCenter();
96
97
    this.beforeRender(ol.animation.rotate({
0 ignored issues
show
Bug introduced by
The variable ol seems to be never declared. If this is a global, consider adding a /** global: ol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
98
        'rotation':view.getRotation(),
99
        'anchor':center,
100
        'duration':200
101
    }));
102
    view.rotate(rotate, center);
103
    if (this.ov_view != null) {
104
        this.ov_view.rotate(rotate);
105
    }
106
};
107
108
/**
109
 * Rotate the map in the left direction
110
 */
111
ol.Map.prototype.rotateLeft = function() {
112
    this.rotate(-5);
113
    if (this.ov_view != null) {
114
        this.ov_view.rotate(-5);
115
    }
116
};
117
118
/**
119
 * Rotate the map in the right direction
120
 */
121
ol.Map.prototype.rotateRight = function() {
0 ignored issues
show
Bug introduced by
The variable ol seems to be never declared. If this is a global, consider adding a /** global: ol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
122
    this.rotate(5);
123
    if (this.ov_view != null) {
124
        this.ov_view.rotate(5);
125
    }
126
};
127
128
/**
129
 * Resets the rotation of the map
130
 */
131
ol.Map.prototype.resetRotation = function() {
0 ignored issues
show
Bug introduced by
The variable ol seems to be never declared. If this is a global, consider adding a /** global: ol */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
132
    this.getView().rotate(0, this.getView().getCenter());
133
    if (this.ov_view != null) {
134
        this.ov_view.rotate(0);
135
    }
136
};