Passed
Push — master ( 33081a...0dd98d )
by Paul
05:28
created

+/scripts/admin/notices.js   A

Complexity

Total Complexity 4
Complexity/F 2

Size

Lines of Code 14
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 14
rs 10
c 1
b 0
f 0
wmc 4
mnd 1
bc 3
fnc 2
bpm 1.5
cpm 2
noi 0

1 Function

Rating   Name   Duplication   Size   Complexity  
A GLSR.Notices 0 9 3
1
/** global: GLSR, jQuery */
2
;(function( x ) {
3
4
	'use strict';
5
6
	GLSR.Notices = function( notices ) { // string
7
		if( !notices )return;
8
		if( !x( '#glsr-notices' ).length ) {
9
			x( '#message.notice' ).remove();
10
			x( 'form#post' ).before( '<div id="glsr-notices" />' );
11
		}
12
		x( '#glsr-notices' ).html( notices );
13
		x( document ).trigger( 'wp-updates-notice-added' );
14
	};
15
})( jQuery );
16