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
Push — master ( f78b16...893a4d )
by Dennis
02:23
created

demo.js ➔ resetFilters   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
nc 1
nop 1
dl 0
loc 7
rs 9.4285
c 0
b 0
f 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A demo.js ➔ ... ➔ targets.filter 0 5 1
1
var targets = Object.keys(document.querySelectorAll('[data-vanillatrigger]')).map(function(index) {
2
	return document.querySelectorAll('[data-vanillatrigger]')[index];
3
});
4
5
targets.filter(function(item) {
6
	item.addEventListener('click', function() {
7
8
		// Uncheck all triggers
9
		if(typeof item.value === 'undefined' || item.value === "") {
10
			resetFilters(targets);
0 ignored issues
show
Best Practice introduced by
There is no return statement in this branch, but you do return something in other branches. Did you maybe miss it? If you do not want to return anything, consider adding return undefined; explicitly.
Loading history...
11
		} else {
12
			if(VF.options.vanillaSingleFilter) {
0 ignored issues
show
Bug introduced by
The variable VF seems to be never declared. If this is a global, consider adding a /** global: VF */ 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...
13
				resetFilters(targets);
14
			}
15
16
			item.checked = true;
17
18
			return item.classList.toggle('is-active');
19
		}
20
	});
21
});
22
23
function resetFilters(targets) {
24
	targets.filter(function(item) {
25
		item.checked = false;
26
27
		return item.classList.remove('is-active');
28
	});
29
}
30