Passed
Pull Request — dev/6.0.0 (#296)
by Sudar
13:50 queued 09:51
created

$(document).ready   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 15

Duplication

Lines 0
Ratio 0 %

Importance

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

1 Function

Rating   Name   Duplication   Size   Complexity  
A 0 10 2
1
jQuery( document ).ready( function () {
2
	jQuery( '.select2-post' ).select2( {
3
		width: '300px',
4
		templateSelection: function (state) {
5
			if (!state.id) {
6
				return state.text;
7
			}
8
			var parentLabel = state.element.parentElement.label;
9
			var $state = jQuery(
10
				'<span>' + parentLabel + '-' + state.text + '</span>'
11
			);
12
			return $state;
13
		}
14
	});
15
});