Completed
Pull Request — master (#328)
by
unknown
02:43
created

js/gallerypublic.js   A

Complexity

Conditions 1
Paths 2

Size

Total Lines 16

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
nc 2
nop 3
dl 0
loc 16
rs 9.4285
c 1
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A OCA.Files.Files.getDownloadUrl 0 13 3
1
/**
2
 * Nextcloud - Gallery
3
 *
4
 *
5
 * This file is licensed under the Affero General Public License version 3 or
6
 * later. See the COPYING file.
7
 *
8
 * @author Cédric de Saint Martin <[email protected]>
9
 *
10
 * @copyright Olivier Paroz 2017
11
 */
12
/* global OCA */
13
(function ($, OC, t) {
0 ignored issues
show
Unused Code introduced by
The parameter t is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
t does not seem to be used.
Loading history...
14
	"use strict";
15
	OCA.Files.Files.getDownloadUrl = function (filename, dir, isDir) {
0 ignored issues
show
Unused Code introduced by
The parameter isDir is not used and could be removed.

This check looks for parameters in functions that are not used in the function body and are not followed by other parameters which are used inside the function.

Loading history...
Unused Code introduced by
isDir does not seem to be used.
Loading history...
16
		var path = dir || this.getCurrentDirectory();
17
		if (_.isArray(filename)) {
18
			filename = JSON.stringify(filename);
19
		}
20
		var params = {
21
			path: path
22
		};
23
		if (filename) {
24
			params.files = filename;
25
		}
26
		return OC.generateUrl('/s/' + Gallery.token + '/download') + '?' + OC.buildQueryString(params);
0 ignored issues
show
Bug introduced by
The variable Gallery seems to be never declared. If this is a global, consider adding a /** global: Gallery */ 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...
Bug introduced by
Gallery does not seem to be defined.
Loading history...
27
	};
28
})(jQuery, OC, t);
29