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

Failed Conditions
Pull Request — master (#1101)
by Dan
05:32
created

src/htdocs/js/uni_gen.js   A

Complexity

Total Complexity 3
Complexity/F 1

Size

Lines of Code 40
Function Count 3

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 19
c 0
b 0
f 0
dl 0
loc 40
rs 10
wmc 3
mnd 0
bc 0
fnc 3
bpm 0
cpm 1
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A uni_gen.js ➔ setupDragDrop 0 26 3
1
"use strict";
2
3
// Install drag & drop handlers once the page has finished loading
4
window.onload = function() {
5
	setupDragDrop();
6
};
7
8
/**
9
 * Allows locations to be dragged and dropped to different sectors
10
 * with an AJAX update.
11
 *
12
 * This needs to be called every time the elements in the sector map
13
 * update, to install new handlers on the updated elements.
14
 */
15
function setupDragDrop() {
16
17
	// Make the Location images draggable elements
18
	$(".drag_loc").draggable({
19
		addClasses: false,
20
		revert: "invalid",
21
		cursor: "move",
22
	});
23
24
	// The draggable elements can be dropped into any sector
25
	$(".lm_sector").droppable({
26
		addClasses: false,
27
		accept: ".drag_loc",
28
		drop: function(event, ui) {
29
			var href = ui.draggable.data("href");
30
			var data = {
31
				ajax: 1,
32
				TargetSectorID: $(this).find(".lmsector").text(),
33
				OrigSectorID: ui.draggable.data("sector"),
34
				LocationTypeID: ui.draggable.data("loc"),
35
			};
36
			ajaxLink(href, setupDragDrop, data);
37
		},
38
	});
39
40
}
41