Passed
Push — master ( 498725...4036bc )
by Paul
04:49
created

+/scripts/admin/console.js   A

Complexity

Total Complexity 4
Complexity/F 1

Size

Lines of Code 22
Function Count 4

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

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

2 Functions

Rating   Name   Duplication   Size   Complexity  
A Console.onClick_ 0 9 1
A console.js ➔ Console 0 3 1
1
/** global: GLSR, jQuery */
2
;(function( x ) {
3
4
	'use strict';
5
6
	var Console = function() {
0 ignored issues
show
Comprehensibility introduced by
You are shadowing the built-in type Console. This makes code hard to read, consider using a different name.
Loading history...
7
		x( 'form' ).on( 'click', '#clear-console', this.onClick_ );
8
	};
9
10
	Console.prototype = {
0 ignored issues
show
Compatibility Best Practice introduced by
You are extending the built-in type Console. This may have unintended consequences on other objects using this built-in type. Consider subclassing instead.
Loading history...
11
		onClick_: function( ev ) {
12
		 	var request = {
13
				action: 'clear-console',
14
			};
15
			(new GLSR.Ajax( request, ev )).post( function( response ) {
16
				GLSR.Notices( response.notices );
17
				x( '#console' ).val( response.console );
18
			});
19
		},
20
	};
21
22
	GLSR.Console = Console;
23
})( jQuery );
24