Completed
Pull Request — master (#90)
by Janis
06:25
created

js/dist/ocrpersonal.js   F

Complexity

Total Complexity 107
Complexity/F 1.91

Size

Lines of Code 361
Function Count 56

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 107
dl 0
loc 361
rs 3.12
c 0
b 0
f 0
cc 0
nc 0
mnd 3
bc 62
fnc 56
bpm 1.1071
cpm 1.9107
noi 62

1 Function

Rating   Name   Duplication   Size   Complexity  
B ocrpersonal.js ➔ ?!? 0 41 1

How to fix   Complexity   

Complexity

Complex classes like js/dist/ocrpersonal.js often do a lot of different things. To break such a class down, we need to identify a cohesive component within that class. A common approach to find such a component is to look for fields/methods that share the same prefixes, or suffixes.

Once you have determined the fields that belong together, you can apply the Extract Class refactoring. If the component makes sense as a sub-class, Extract Subclass is also a candidate, and is often faster.

1
(function webpackUniversalModuleDefinition(root, factory) {
2
	if(typeof exports === 'object' && typeof module === 'object')
3
		module.exports = factory(require("underscore"), require("handlebars/runtime"), require("jQuery"));
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
4
	else if(typeof define === 'function' && define.amd)
0 ignored issues
show
Bug introduced by
The variable define seems to be never declared. If this is a global, consider adding a /** global: define */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
5
		define(["underscore", "handlebars/runtime", "jQuery"], factory);
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
6
	else if(typeof exports === 'object')
7
		exports["Ocr"] = factory(require("underscore"), require("handlebars/runtime"), require("jQuery"));
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
Coding Style introduced by
['Ocr'] could be written in dot notation.

You can rewrite this statement in dot notation:

var obj = { };
obj['foo'] = 'bar'; // Bad
obj.foo = 'bar'; // Good
Loading history...
8
	else
9
		root["OCA"] = root["OCA"] || {}, root["OCA"]["Ocr"] = factory(root["_"], root["Handlebars"], root["$"]);
0 ignored issues
show
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
Coding Style introduced by
['OCA'] could be written in dot notation.

You can rewrite this statement in dot notation:

var obj = { };
obj['foo'] = 'bar'; // Bad
obj.foo = 'bar'; // Good
Loading history...
Coding Style introduced by
['Ocr'] could be written in dot notation.

You can rewrite this statement in dot notation:

var obj = { };
obj['foo'] = 'bar'; // Bad
obj.foo = 'bar'; // Good
Loading history...
Coding Style introduced by
['_'] could be written in dot notation.

You can rewrite this statement in dot notation:

var obj = { };
obj['foo'] = 'bar'; // Bad
obj.foo = 'bar'; // Good
Loading history...
Coding Style introduced by
['Handlebars'] could be written in dot notation.

You can rewrite this statement in dot notation:

var obj = { };
obj['foo'] = 'bar'; // Bad
obj.foo = 'bar'; // Good
Loading history...
Coding Style introduced by
['$'] could be written in dot notation.

You can rewrite this statement in dot notation:

var obj = { };
obj['foo'] = 'bar'; // Bad
obj.foo = 'bar'; // Good
Loading history...
Bug introduced by
Did you forget to assign or call a function?

This error message can for example pop up if you forget to assign the result of a function call to a variable or pass it to another function:

function someFunction(x) {
    (x > 0) ? callFoo() : callBar();
}

// JSHint expects you to assign the result to a variable:
function someFunction(x) {
    var rs = (x > 0) ? callFoo() : callBar();
}

// If you do not use the result, you could also use if statements in the
// case above.
function someFunction(x) {
    if (x > 0) {
        callFoo();
    } else {
        callBar();
    }
}
Loading history...
10
})(this, function(__WEBPACK_EXTERNAL_MODULE_5__, __WEBPACK_EXTERNAL_MODULE_10__, __WEBPACK_EXTERNAL_MODULE_11__) {
11
return /******/ (function(modules) { // webpackBootstrap
12
/******/ 	// The module cache
13
/******/ 	var installedModules = {};
14
15
/******/ 	// The require function
16
/******/ 	function __webpack_require__(moduleId) {
17
18
/******/ 		// Check if module is in cache
19
/******/ 		if(installedModules[moduleId])
20
/******/ 			return installedModules[moduleId].exports;
0 ignored issues
show
Coding Style Best Practice introduced by
Curly braces around statements make for more readable code and help prevent bugs when you add further statements.

Consider adding curly braces around all statements when they are executed conditionally. This is optional if there is only one statement, but leaving them out can lead to unexpected behaviour if another statement is added later.

Consider:

if (a > 0)
    b = 42;

If you or someone else later decides to put another statement in, only the first statement will be executed.

if (a > 0)
    console.log("a > 0");
    b = 42;

In this case the statement b = 42 will always be executed, while the logging statement will be executed conditionally.

if (a > 0) {
    console.log("a > 0");
    b = 42;
}

ensures that the proper code will be executed conditionally no matter how many statements are added or removed.

Loading history...
21
22
/******/ 		// Create a new module (and put it into the cache)
23
/******/ 		var module = installedModules[moduleId] = {
24
/******/ 			exports: {},
25
/******/ 			id: moduleId,
26
/******/ 			loaded: false
27
/******/ 		};
28
29
/******/ 		// Execute the module function
30
/******/ 		modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
31
32
/******/ 		// Flag the module as loaded
33
/******/ 		module.loaded = true;
34
35
/******/ 		// Return the exports of the module
36
/******/ 		return module.exports;
37
/******/ 	}
38
39
40
/******/ 	// expose the modules object (__webpack_modules__)
41
/******/ 	__webpack_require__.m = modules;
42
43
/******/ 	// expose the module cache
44
/******/ 	__webpack_require__.c = installedModules;
45
46
/******/ 	// __webpack_public_path__
47
/******/ 	__webpack_require__.p = "";
48
49
/******/ 	// Load entry module and return exports
50
/******/ 	return __webpack_require__(0);
51
/******/ })
52
/************************************************************************/
53
/******/ ([
0 ignored issues
show
introduced by
There are two consecutive commas which insert an implicit undefined value. If this is indeed intended, consider adding undefined explicitly like so , undefined,.
Loading history...
54
/* 0 */
55
/***/ (function(module, exports, __webpack_require__) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
56
57
	"use strict";
58
	Object.defineProperty(exports, "__esModule", { value: true });
59
	var view_1 = __webpack_require__(12);
60
	var controller_1 = __webpack_require__(13);
61
	var configuration_1 = __webpack_require__(14);
62
	var http_service_1 = __webpack_require__(15);
63
	var handlebarsTableTemplate = __webpack_require__(16);
64
	var underscore_1 = __webpack_require__(5);
0 ignored issues
show
Unused Code introduced by
The variable underscore_1 seems to be never used. Consider removing it.
Loading history...
65
	var jquery_1 = __webpack_require__(11);
0 ignored issues
show
Unused Code introduced by
The variable jquery_1 seems to be never used. Consider removing it.
Loading history...
66
	var Personal = (function () {
67
	    function Personal() {
68
	        var _this = this;
69
	        _.delay(function () {
0 ignored issues
show
Bug introduced by
The variable _ seems to be never declared. If this is a global, consider adding a /** global: _ */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
70
	            _this.config = new configuration_1.Configuration();
71
	            _this.view = new view_1.View(OC.Notification, handlebarsTableTemplate, t, $, document);
0 ignored issues
show
Bug introduced by
The variable t seems to be never declared. If this is a global, consider adding a /** global: t */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
Bug introduced by
The variable OC seems to be never declared. If this is a global, consider adding a /** global: OC */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
72
	            _this.httpService = new http_service_1.HttpService(_this.config, $);
73
	            _this.controller = new controller_1.Controller(_this.view, _this.httpService, document, $, t);
74
	            try {
75
	                _this.controller.init();
76
	            }
77
	            catch (e) {
78
	                console.error(e);
79
	                _this.view.displayMessage(e.message, true);
80
	            }
81
	        }, 1000);
82
	    }
83
	    return Personal;
84
	}());
85
	exports.Personal = Personal;
86
	exports.$personal = new Personal();
87
88
89
/***/ }),
90
/* 1 */,
0 ignored issues
show
introduced by
Empty array elements require elision=true.
Loading history...
91
/* 2 */,
92
/* 3 */,
93
/* 4 */,
94
/* 5 */
95
/***/ (function(module, exports) {
96
97
	module.exports = __WEBPACK_EXTERNAL_MODULE_5__;
98
99
/***/ }),
100
/* 6 */,
0 ignored issues
show
introduced by
Empty array elements require elision=true.
Loading history...
101
/* 7 */,
102
/* 8 */,
103
/* 9 */,
104
/* 10 */
105
/***/ (function(module, exports) {
106
107
	module.exports = __WEBPACK_EXTERNAL_MODULE_10__;
108
109
/***/ }),
110
/* 11 */
111
/***/ (function(module, exports) {
112
113
	module.exports = __WEBPACK_EXTERNAL_MODULE_11__;
114
115
/***/ }),
116
/* 12 */
117
/***/ (function(module, exports) {
118
119
	"use strict";
120
	Object.defineProperty(exports, "__esModule", { value: true });
121
	var View = (function () {
122
	    function View(notification, handlebarsTableTemplateFunction, t, jquery, document) {
123
	        this.notification = notification;
124
	        this.handlebarsTableTemplateFunction = handlebarsTableTemplateFunction;
125
	        this.t = t;
126
	        this.jquery = jquery;
127
	        this.document = document;
128
	        this.el = this.document.getElementById('ocr-settings');
129
	    }
130
	    View.prototype.displayMessage = function (message, error) {
131
	        if (error) {
132
	            this.notification.showHtml("<div>" + message + "</div>", { timeout: 10, type: 'error' });
133
	        }
134
	        else {
135
	            this.notification.showHtml("<div>" + message + "</div>", { timeout: 10 });
136
	        }
137
	    };
138
	    View.prototype.render = function (status) {
139
	        var html = this.renderTable(status);
140
	        this.appendHtmlToElement(html, this.el);
141
	    };
142
	    View.prototype.destroy = function () {
143
	        this.el.innerHTML = '';
144
	    };
145
	    View.prototype.renderTable = function (status) {
146
	        var template = this.handlebarsTableTemplateFunction;
147
	        var enabled = status && status.length > 0 ? true : false;
148
	        return template({
149
	            deleteText: t('ocr', 'Delete'),
150
	            enabled: enabled,
151
	            noPendingOrFailedText: t('ocr', 'No pending or failed OCR items found.'),
152
	            refreshButtonText: t('ocr', 'Refresh'),
153
	            status: status,
154
	            tableHeadDeleteFromQueueText: t('ocr', 'Delete from queue'),
155
	            tableHeadNameText: t('ocr', 'Name'),
156
	            tableHeadStatusText: t('ocr', 'Status'),
157
	        });
158
	    };
159
	    View.prototype.appendHtmlToElement = function (html, el) {
160
	        this.jquery(html).appendTo(el);
161
	    };
162
	    Object.defineProperty(View.prototype, "el", {
163
	        get: function () {
164
	            return this._el;
165
	        },
166
	        set: function (value) {
167
	            this._el = value;
168
	        },
169
	        enumerable: true,
170
	        configurable: true
171
	    });
172
	    return View;
173
	}());
174
	exports.View = View;
175
176
177
/***/ }),
178
/* 13 */
179
/***/ (function(module, exports) {
180
181
	"use strict";
182
	Object.defineProperty(exports, "__esModule", { value: true });
183
	var Controller = (function () {
184
	    function Controller(view, httpService, document, jquery, t) {
185
	        this.view = view;
186
	        this.httpService = httpService;
187
	        this.document = document;
188
	        this.jquery = jquery;
189
	        this.t = t;
190
	        this._status = [];
191
	    }
192
	    Controller.prototype.init = function () {
193
	        this.loadAndRender();
194
	        this.registerEvents();
195
	    };
196
	    Controller.prototype.destroy = function () {
197
	        this.view.destroy();
198
	    };
199
	    Controller.prototype.loadAndRender = function () {
200
	        var _this = this;
201
	        this.httpService.getAllStatus().always(function () {
202
	            _this.view.destroy();
203
	        }).done(function (status) {
204
	            _this.status = status;
205
	            _this.view.render(_this.status);
206
	        }).fail(function (jqXHR) {
207
	            _this.view.displayMessage(t('ocr', 'OCR status could not be retrieved:') + " " + jqXHR.responseText, true);
208
	            _this.status = [];
209
	            _this.view.render(_this.status);
210
	        });
211
	    };
212
	    Controller.prototype.delete = function (id) {
213
	        var _this = this;
214
	        this.httpService.deleteStatus(id).done(function () {
215
	            _this.view.destroy();
216
	            var status = _this.status.filter(function (s) { return s.id === id; });
217
	            _this.status = _this.status.filter(function (s) {
218
	                return s.id !== id;
219
	            });
220
	            _this.view.displayMessage(t('ocr', 'Following status object has been successfully deleted:') + " " + status[0].target, false);
221
	            _this.view.render(_this.status);
222
	        }).fail(function (jqXHR) {
223
	            _this.view.displayMessage(t('ocr', 'Error during deletion:') + " " + jqXHR.responseText, true);
224
	            _this.loadAndRender();
225
	        });
226
	    };
227
	    Controller.prototype.registerEvents = function () {
228
	        var _this = this;
229
	        this.document.addEventListener('click', function (event) {
230
	            if (event.target.id === 'ocr-search') {
231
	                _this.loadAndRender();
232
	            }
233
	        });
234
	        this.document.addEventListener('click', function (event) {
235
	            if (event.target.id === 'ocr-delete' || event.target.parentNode.id === 'ocr-delete') {
236
	                _this.delete(event.target.closest('tr').dataset.id - 0);
237
	            }
238
	        });
239
	    };
240
	    Object.defineProperty(Controller.prototype, "status", {
241
	        get: function () {
242
	            return this._status;
243
	        },
244
	        set: function (value) {
245
	            this._status = value;
246
	        },
247
	        enumerable: true,
248
	        configurable: true
249
	    });
250
	    return Controller;
251
	}());
252
	exports.Controller = Controller;
253
254
255
/***/ }),
256
/* 14 */
257
/***/ (function(module, exports) {
258
259
	"use strict";
260
	Object.defineProperty(exports, "__esModule", { value: true });
261
	var Configuration = (function () {
262
	    function Configuration() {
263
	        this._personalSettingsEndpoint = OC.generateUrl('/apps/ocr/settings/personal');
0 ignored issues
show
Bug introduced by
The variable OC seems to be never declared. If this is a global, consider adding a /** global: OC */ comment.

This checks looks for references to variables that have not been declared. This is most likey a typographical error or a variable has been renamed.

To learn more about declaring variables in Javascript, see the MDN.

Loading history...
264
	    }
265
	    Object.defineProperty(Configuration.prototype, "personalSettingsEndpoint", {
266
	        get: function () {
267
	            return this._personalSettingsEndpoint;
268
	        },
269
	        enumerable: true,
270
	        configurable: true
271
	    });
272
	    return Configuration;
273
	}());
274
	exports.Configuration = Configuration;
275
276
277
/***/ }),
278
/* 15 */
279
/***/ (function(module, exports) {
280
281
	"use strict";
282
	Object.defineProperty(exports, "__esModule", { value: true });
283
	var HttpService = (function () {
284
	    function HttpService(config, jquery) {
285
	        this.config = config;
286
	        this.jquery = jquery;
287
	    }
288
	    HttpService.prototype.makeRequest = function (opts) {
289
	        return this.jquery.ajax(opts);
290
	    };
291
	    HttpService.prototype.getAllStatus = function () {
292
	        var options = {
293
	            method: 'GET',
294
	            url: this.config.personalSettingsEndpoint,
295
	        };
296
	        return this.makeRequest(options);
297
	    };
298
	    HttpService.prototype.deleteStatus = function (id) {
299
	        var options = {
300
	            data: {
301
	                id: id,
302
	            },
303
	            method: 'DELETE',
304
	            url: this.config.personalSettingsEndpoint,
305
	        };
306
	        return this.makeRequest(options);
307
	    };
308
	    return HttpService;
309
	}());
310
	exports.HttpService = HttpService;
311
312
313
/***/ }),
314
/* 16 */
315
/***/ (function(module, exports, __webpack_require__) {
316
317
	var Handlebars = __webpack_require__(10);
318
	function __default(obj) { return obj && (obj.__esModule ? obj["default"] : obj); }
0 ignored issues
show
introduced by
The function __default does not seem to be used and can be removed.
Loading history...
319
	module.exports = (Handlebars["default"] || Handlebars).template({"1":function(container,depth0,helpers,partials,data,blockParams,depths) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
320
	    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
0 ignored issues
show
Coding Style introduced by
It is recommended to use !== to compare with null.

Generally, it is recommended to use strict comparison whenever possible and not to rely on the weaker type-juggling comparison operator.

Read more about comparison operations.

Loading history...
321
322
	  return "<table class=\"grid ocrsettings\">\n    <thead>\n        <tr>\n            <th>"
323
	    + alias4(((helper = (helper = helpers.tableHeadNameText || (depth0 != null ? depth0.tableHeadNameText : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tableHeadNameText","hash":{},"data":data}) : helper)))
0 ignored issues
show
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
Bug introduced by
There seems to be a bad line break before +.
Loading history...
Coding Style introduced by
It is recommended to use !== to compare with null.

Generally, it is recommended to use strict comparison whenever possible and not to rely on the weaker type-juggling comparison operator.

Read more about comparison operations.

Loading history...
324
	    + "</th>\n            <th>"
0 ignored issues
show
Bug introduced by
There seems to be a bad line break before +.
Loading history...
325
	    + alias4(((helper = (helper = helpers.tableHeadStatusText || (depth0 != null ? depth0.tableHeadStatusText : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tableHeadStatusText","hash":{},"data":data}) : helper)))
0 ignored issues
show
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
Bug introduced by
There seems to be a bad line break before +.
Loading history...
Coding Style introduced by
It is recommended to use !== to compare with null.

Generally, it is recommended to use strict comparison whenever possible and not to rely on the weaker type-juggling comparison operator.

Read more about comparison operations.

Loading history...
326
	    + "</th>\n            <th>"
0 ignored issues
show
Bug introduced by
There seems to be a bad line break before +.
Loading history...
327
	    + alias4(((helper = (helper = helpers.tableHeadDeleteFromQueueText || (depth0 != null ? depth0.tableHeadDeleteFromQueueText : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"tableHeadDeleteFromQueueText","hash":{},"data":data}) : helper)))
0 ignored issues
show
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
Bug introduced by
There seems to be a bad line break before +.
Loading history...
Coding Style introduced by
It is recommended to use !== to compare with null.

Generally, it is recommended to use strict comparison whenever possible and not to rely on the weaker type-juggling comparison operator.

Read more about comparison operations.

Loading history...
328
	    + "</th>\n        </tr>\n    </thead>\n    <tbody>\n"
0 ignored issues
show
Bug introduced by
There seems to be a bad line break before +.
Loading history...
329
	    + ((stack1 = helpers.each.call(alias1,(depth0 != null ? depth0.status : depth0),{"name":"each","hash":{},"fn":container.program(2, data, 0, blockParams, depths),"inverse":container.noop,"data":data})) != null ? stack1 : "")
0 ignored issues
show
Bug introduced by
There seems to be a bad line break before +.
Loading history...
Coding Style introduced by
It is recommended to use !== to compare with null.

Generally, it is recommended to use strict comparison whenever possible and not to rely on the weaker type-juggling comparison operator.

Read more about comparison operations.

Loading history...
330
	    + "    </tbody>\n</table>\n";
0 ignored issues
show
Bug introduced by
There seems to be a bad line break before +.
Loading history...
331
	},"2":function(container,depth0,helpers,partials,data,blockParams,depths) {
0 ignored issues
show
Duplication introduced by
This code seems to be duplicated in your project.
Loading history...
332
	    var helper, alias1=depth0 != null ? depth0 : (container.nullContext || {}), alias2=helpers.helperMissing, alias3="function", alias4=container.escapeExpression;
0 ignored issues
show
Coding Style introduced by
It is recommended to use !== to compare with null.

Generally, it is recommended to use strict comparison whenever possible and not to rely on the weaker type-juggling comparison operator.

Read more about comparison operations.

Loading history...
333
334
	  return "        <tr data-id=\""
335
	    + alias4(((helper = (helper = helpers.id || (depth0 != null ? depth0.id : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"id","hash":{},"data":data}) : helper)))
0 ignored issues
show
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
Bug introduced by
There seems to be a bad line break before +.
Loading history...
Coding Style introduced by
It is recommended to use !== to compare with null.

Generally, it is recommended to use strict comparison whenever possible and not to rely on the weaker type-juggling comparison operator.

Read more about comparison operations.

Loading history...
336
	    + "\">\n            <td>"
0 ignored issues
show
Bug introduced by
There seems to be a bad line break before +.
Loading history...
337
	    + alias4(((helper = (helper = helpers.target || (depth0 != null ? depth0.target : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"target","hash":{},"data":data}) : helper)))
0 ignored issues
show
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
Bug introduced by
There seems to be a bad line break before +.
Loading history...
Coding Style introduced by
It is recommended to use !== to compare with null.

Generally, it is recommended to use strict comparison whenever possible and not to rely on the weaker type-juggling comparison operator.

Read more about comparison operations.

Loading history...
338
	    + "</td>\n            <td>"
0 ignored issues
show
Bug introduced by
There seems to be a bad line break before +.
Loading history...
339
	    + alias4(((helper = (helper = helpers.status || (depth0 != null ? depth0.status : depth0)) != null ? helper : alias2),(typeof helper === alias3 ? helper.call(alias1,{"name":"status","hash":{},"data":data}) : helper)))
0 ignored issues
show
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
Bug introduced by
There seems to be a bad line break before +.
Loading history...
Coding Style introduced by
It is recommended to use !== to compare with null.

Generally, it is recommended to use strict comparison whenever possible and not to rely on the weaker type-juggling comparison operator.

Read more about comparison operations.

Loading history...
340
	    + "</td>\n            <td class=\"ocr-action-delete\">\n                <div id=\"ocr-delete\"><span>"
0 ignored issues
show
Bug introduced by
There seems to be a bad line break before +.
Loading history...
341
	    + alias4(container.lambda((depths[1] != null ? depths[1].deleteText : depths[1]), depth0))
0 ignored issues
show
Bug introduced by
There seems to be a bad line break before +.
Loading history...
Coding Style introduced by
It is recommended to use !== to compare with null.

Generally, it is recommended to use strict comparison whenever possible and not to rely on the weaker type-juggling comparison operator.

Read more about comparison operations.

Loading history...
342
	    + "</span><span class=\"icon icon-delete\"></span></div>\n            </td>\n        </tr>\n";
0 ignored issues
show
Bug introduced by
There seems to be a bad line break before +.
Loading history...
343
	},"4":function(container,depth0,helpers,partials,data) {
344
	    var helper;
345
346
	  return "<p>"
347
	    + container.escapeExpression(((helper = (helper = helpers.noPendingOrFailedText || (depth0 != null ? depth0.noPendingOrFailedText : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(depth0 != null ? depth0 : (container.nullContext || {}),{"name":"noPendingOrFailedText","hash":{},"data":data}) : helper)))
0 ignored issues
show
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
Bug introduced by
There seems to be a bad line break before +.
Loading history...
Coding Style introduced by
It is recommended to use !== to compare with null.

Generally, it is recommended to use strict comparison whenever possible and not to rely on the weaker type-juggling comparison operator.

Read more about comparison operations.

Loading history...
348
	    + "</p>\n";
0 ignored issues
show
Bug introduced by
There seems to be a bad line break before +.
Loading history...
349
	},"compiler":[7,">= 4.0.0"],"main":function(container,depth0,helpers,partials,data,blockParams,depths) {
350
	    var stack1, helper, alias1=depth0 != null ? depth0 : (container.nullContext || {});
0 ignored issues
show
Coding Style introduced by
It is recommended to use !== to compare with null.

Generally, it is recommended to use strict comparison whenever possible and not to rely on the weaker type-juggling comparison operator.

Read more about comparison operations.

Loading history...
Configuration introduced by
There were too many errors found in this file; checking aborted after 96%.

If JSHint finds too many errors in a file, it aborts checking altogether because it suspects a configuration issue.

Further Reading:

Loading history...
351
352
	  return ((stack1 = helpers["if"].call(alias1,(depth0 != null ? depth0.enabled : depth0),{"name":"if","hash":{},"fn":container.program(1, data, 0, blockParams, depths),"inverse":container.program(4, data, 0, blockParams, depths),"data":data})) != null ? stack1 : "")
353
	    + "<button id=\"ocr-search\">"
354
	    + container.escapeExpression(((helper = (helper = helpers.refreshButtonText || (depth0 != null ? depth0.refreshButtonText : depth0)) != null ? helper : helpers.helperMissing),(typeof helper === "function" ? helper.call(alias1,{"name":"refreshButtonText","hash":{},"data":data}) : helper)))
0 ignored issues
show
Comprehensibility introduced by
Usage of the sequence operator is discouraged, since it may lead to obfuscated code.

The sequence or comma operator allows the inclusion of multiple expressions where only is permitted. The result of the sequence is the value of the last expression.

This operator is most often used in for statements.

Used in another places it can make code hard to read, especially when people do not realize it even exists as a seperate operator.

This check looks for usage of the sequence operator in locations where it is not necessary and could be replaced by a series of expressions or statements.

var a,b,c;

a = 1, b = 1,  c= 3;

could just as well be written as:

var a,b,c;

a = 1;
b = 1;
c = 3;

To learn more about the sequence operator, please refer to the MDN.

Loading history...
355
	    + "</button>";
356
	},"useData":true,"useDepths":true});
357
358
/***/ })
359
/******/ ])
360
});
361
;