Passed
Push — 262-fix/delete-sticky-posts ( 13b51e )
by Rajan
08:20
created

assets/js/src/delete-posts-by-sticky-post.js   A

Complexity

Total Complexity 3
Complexity/F 1.5

Size

Lines of Code 15
Function Count 2

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 0
nc 1
dl 0
loc 15
rs 10
c 1
b 0
f 0
wmc 3
mnd 1
bc 4
fnc 2
bpm 2
cpm 1.5
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A BulkWP.validateStickyPostSelect2 0 7 2
1
/**
2
 * Add select2 functionality..
3
 */
4
/* global BulkWP */
5
jQuery( document ).ready( function () {
6
	/**
7
	 * Normal select2.
8
	 */
9
	jQuery( '.select2-sticky-post' ).select2( {
10
		width: '300px'
11
	} );
12
} );
13
BulkWP.validateStickyPostSelect2 = function(that) {
14
	if (null !== jQuery(that).parent().prev().children().find(".select2-sticky-post[multiple]").val()) {
15
		return true;
16
	} else {
17
		return false;
18
	}
19
};