mirror of
https://github.com/Karaka-Management/jsOMS.git
synced 2026-01-11 01:48:40 +00:00
Static analysis fixes
This commit is contained in:
parent
2da76b689b
commit
4dee88645a
|
|
@ -32,7 +32,7 @@
|
|||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
getId ()
|
||||
getId ()
|
||||
{
|
||||
return this.id;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@
|
|||
"use strict";
|
||||
|
||||
jsOMS.Autoloader.defineNamespace('jsOMS.Account');
|
||||
|
||||
|
||||
jsOMS.Account.AccountManager = class {
|
||||
/**
|
||||
* @constructor
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@
|
|||
login ()
|
||||
{
|
||||
const authRequest = new jsOMS.Message.Request.Request();
|
||||
|
||||
|
||||
authRequest.setUri(this.uri);
|
||||
authRequest.setMethod(jsOMS.Message.Request.RequestMethod.POST);
|
||||
authRequest.setResponseType(jsOMS.Message.Request.RequestType.JSON);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
|
||||
jsOMS.Chart.CandlestickChart.prototype.draw = function ()
|
||||
{
|
||||
let bar, svg, x, xAxis1, xAxis2, y, yAxis1, yAxis2, xGrid, yGrid, zoom,
|
||||
let bar, svg, x, xAxis1, xAxis2, y, yAxis1, yAxis2, xGrid, yGrid, zoom,
|
||||
self = this,
|
||||
mm = 50;
|
||||
|
||||
|
|
|
|||
|
|
@ -80,8 +80,8 @@
|
|||
|
||||
jsOMS.Chart.PyramidChart.prototype.draw = function ()
|
||||
{
|
||||
let bar, svg, x, xAxis1, xAxis2, y, yAxis1, yAxis2, xGrid, yGrid, zoom,
|
||||
self = this,
|
||||
let bar, svg, x, xAxis1, xAxis2, y, yAxis1, yAxis2, xGrid, yGrid, zoom,
|
||||
self = this,
|
||||
box = this.chart.chartSelect.node().getBoundingClientRect();
|
||||
|
||||
this.chart.dimension = {
|
||||
|
|
|
|||
|
|
@ -39,7 +39,7 @@
|
|||
|
||||
tpl.parentNode.appendChild(output);
|
||||
|
||||
setTimeout(function ()
|
||||
setTimeout(function ()
|
||||
{
|
||||
document.getElementsByClassName('log-msg')[0].remove();
|
||||
}, 3000);
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@
|
|||
jsOMS.Autoloader.defineNamespace('jsOMS.Message.Notification');
|
||||
|
||||
jsOMS.Message.Notification.NotificationMessage = class {
|
||||
constructor(status, title, message)
|
||||
constructor(status, title, message)
|
||||
{
|
||||
this.status = status;
|
||||
this.title = title;
|
||||
|
|
|
|||
|
|
@ -6,8 +6,10 @@ SHA1 = function (l)
|
|||
}
|
||||
|
||||
l += '';
|
||||
for (var n = Math, c = [1518500249, 1859775393, 2400959708, 3395469782, 1732584193, 4023233417, 2562383102, 271733878, 3285377520, 4294967295], s = n.ceil(l.length / 4) + 2, q = n.ceil(s / 16), g = [], a = 0, h = [], j, d, e, f, m, i, b, k; a < q; a++) {
|
||||
|
||||
for (let n = Math, c = [1518500249, 1859775393, 2400959708, 3395469782, 1732584193, 4023233417, 2562383102, 271733878, 3285377520, 4294967295], s = n.ceil(l.length / 4) + 2, q = n.ceil(s / 16), g = [], a = 0, h = [], j, d, e, f, m, i, b, k; a < q; a++) {
|
||||
g[a] = [];
|
||||
|
||||
for (k = 0; k < 16; ++k) {
|
||||
function o(b, c)
|
||||
{
|
||||
|
|
@ -17,42 +19,50 @@ SHA1 = function (l)
|
|||
g[a][k] = o(0, 24) | o(1, 16) | o(2, 8) | o(3, 0)
|
||||
}
|
||||
}
|
||||
i = l.length * 8 - 8;
|
||||
a = q - 1;
|
||||
|
||||
i = l.length * 8 - 8;
|
||||
a = q - 1;
|
||||
g[a][14] = i / (c[9] + 1);
|
||||
g[a][14] = n.floor(g[a][14]);
|
||||
g[a][15] = i & c[9];
|
||||
|
||||
for (a = 0; a < q; a++) {
|
||||
for (b = 0; b < 16; b++) {
|
||||
h[b] = g[a][b];
|
||||
}
|
||||
|
||||
for (b = 16; b < 80; b++) {
|
||||
h[b] = p(h[b - 3] ^ h[b - 8] ^ h[b - 14] ^ h[b - 16], 1);
|
||||
}
|
||||
|
||||
j = c[4];
|
||||
d = c[5];
|
||||
e = c[6];
|
||||
f = c[7];
|
||||
m = c[8];
|
||||
|
||||
for (b = 0; b < 80; b++) {
|
||||
var r = n.floor(b / 20), t = p(j, 5) + (r < 1 ? d & e ^ ~d & f : r == 2 ? d & e ^ d & f ^ e & f : d ^ e ^ f) + m + c[r] + h[b] & c[9];
|
||||
let r = n.floor(b / 20), t = p(j, 5) + (r < 1 ? d & e ^ ~d & f : r == 2 ? d & e ^ d & f ^ e & f : d ^ e ^ f) + m + c[r] + h[b] & c[9];
|
||||
m = f;
|
||||
f = e;
|
||||
e = p(d, 30);
|
||||
d = j;
|
||||
j = t
|
||||
}
|
||||
|
||||
c[4] += j;
|
||||
c[5] += d;
|
||||
c[6] += e;
|
||||
c[7] += f;
|
||||
c[8] += m
|
||||
}
|
||||
|
||||
i = "";
|
||||
for (z = 4; z < 9; z++) {
|
||||
for (a = 7; a >= 0; a--) {
|
||||
i += ((c[z] & c[9]) >>> a * 4 & 15).toString(16);
|
||||
}
|
||||
}
|
||||
|
||||
return i;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,39 +19,42 @@ function SHA1(s)
|
|||
|
||||
function A(a, b)
|
||||
{
|
||||
var c = (b & 0xFFFF) + (a & 0xFFFF), d = (b >>> 16) + (a >>> 16) + (c >>> 16);
|
||||
let c = (b & 0xFFFF) + (a & 0xFFFF), d = (b >>> 16) + (a >>> 16) + (c >>> 16);
|
||||
return ((d & 0xFFFF) << 16) | (c & 0xFFFF)
|
||||
}
|
||||
|
||||
var B = '0123456789abcdef';
|
||||
return (function (a)
|
||||
{
|
||||
var c = [], d = a.length * 4, e;
|
||||
for (var i = 0; i < d; i++) {
|
||||
let c = [], d = a.length * 4, e;
|
||||
for (let i = 0; i < d; i++) {
|
||||
e = a[i >> 2] >> ((3 - (i % 4)) * 8);
|
||||
c.push(B.charAt((e >> 4) & 0xF) + B.charAt(e & 0xF))
|
||||
}
|
||||
return c.join('')
|
||||
}((function (a, b)
|
||||
{
|
||||
var c, d, e, f, g, h = a.length, v = 0x67452301, w = 0xefcdab89, x = 0x98badcfe, y = 0x10325476, z = 0xc3d2e1f0, M = [];
|
||||
let c, d, e, f, g, h = a.length, v = 0x67452301, w = 0xefcdab89, x = 0x98badcfe, y = 0x10325476, z = 0xc3d2e1f0, M = [];
|
||||
U(M, 0x5a827999, 20);
|
||||
U(M, 0x6ed9eba1, 20);
|
||||
U(M, 0x8f1bbcdc, 20);
|
||||
U(M, 0xca62c1d6, 20);
|
||||
a[b >> 5] |= 0x80 << (24 - (b % 32));
|
||||
|
||||
a[b >> 5] |= 0x80 << (24 - (b % 32));
|
||||
a[(((b + 65) >> 9) << 4) + 15] = b;
|
||||
for (var i = 0; i < h; i += 16) {
|
||||
|
||||
for (let i = 0; i < h; i += 16) {
|
||||
c = v;
|
||||
d = w;
|
||||
e = x;
|
||||
f = y;
|
||||
g = z;
|
||||
for (var j = 0, O = []; j < 80; j++) {
|
||||
|
||||
for (let j = 0, O = []; j < 80; j++) {
|
||||
O[j] = j < 16 ? a[j + i] : L(O[j - 3] ^ O[j - 8] ^ O[j - 14] ^ O[j - 16], 1);
|
||||
var k = (function (a, b, c, d, e)
|
||||
let k = (function (a, b, c, d, e)
|
||||
{
|
||||
var f = (e & 0xFFFF) + (a & 0xFFFF) + (b & 0xFFFF) + (c & 0xFFFF) + (d & 0xFFFF), g = (e >>> 16) + (a >>> 16) + (b >>> 16) + (c >>> 16) + (d >>> 16) + (f >>> 16);
|
||||
let f = (e & 0xFFFF) + (a & 0xFFFF) + (b & 0xFFFF) + (c & 0xFFFF) + (d & 0xFFFF), g = (e >>> 16) + (a >>> 16) + (b >>> 16) + (c >>> 16) + (d >>> 16) + (f >>> 16);
|
||||
return ((g & 0xFFFF) << 16) | (f & 0xFFFF)
|
||||
})(j < 20 ? (function (t, a, b)
|
||||
{
|
||||
|
|
@ -60,25 +63,30 @@ function SHA1(s)
|
|||
{
|
||||
return (t & a) ^ (t & b) ^ (a & b)
|
||||
}(d, e, f)) : P(d, e, f), g, M[j], O[j], L(c, 5));
|
||||
|
||||
g = f;
|
||||
f = e;
|
||||
e = L(d, 30);
|
||||
d = c;
|
||||
c = k
|
||||
}
|
||||
|
||||
v = A(v, c);
|
||||
w = A(w, d);
|
||||
x = A(x, e);
|
||||
y = A(y, f);
|
||||
z = A(z, g)
|
||||
}
|
||||
|
||||
return [v, w, x, y, z]
|
||||
}((function (t)
|
||||
{
|
||||
var a = [], b = 255, c = t.length * 8;
|
||||
for (var i = 0; i < c; i += 8) {
|
||||
let a = [], b = 255, c = t.length * 8;
|
||||
|
||||
for (let i = 0; i < c; i += 8) {
|
||||
a[i >> 5] |= (t.charCodeAt(i / 8) & b) << (24 - (i % 32))
|
||||
}
|
||||
|
||||
return a
|
||||
}(s)).slice(), s.length * 8))))
|
||||
}
|
||||
|
|
|
|||
|
|
@ -110,7 +110,7 @@
|
|||
length = actions.length;
|
||||
|
||||
for (let i = 0; i < length; ++i) {
|
||||
if ((!actions[i].exact || event.target.getAttribute('id') === element)
|
||||
if ((!actions[i].exact || event.target.getAttribute('id') === element)
|
||||
&& actions[i].button === event.button
|
||||
) {
|
||||
jsOMS.preventAll(event);
|
||||
|
|
|
|||
|
|
@ -72,7 +72,7 @@
|
|||
}
|
||||
|
||||
this.recognition.onstart = function() {};
|
||||
this.recognition.onresult = function(event)
|
||||
this.recognition.onresult = function(event)
|
||||
{
|
||||
let result = jsOMS.trim(event.results[event.resultIndex][0].transcript);
|
||||
|
||||
|
|
@ -81,16 +81,16 @@
|
|||
}
|
||||
};
|
||||
|
||||
this.recognition.onspeechend = function()
|
||||
this.recognition.onspeechend = function()
|
||||
{
|
||||
};
|
||||
|
||||
this.recognition.onnomatch = function(event)
|
||||
this.recognition.onnomatch = function(event)
|
||||
{
|
||||
jsOMS.Log.Logger.instance.warning('Couldn\'t recognize speech');
|
||||
};
|
||||
|
||||
this.recognition.onerror = function(event)
|
||||
this.recognition.onerror = function(event)
|
||||
{
|
||||
jsOMS.Log.Logger.instance.warning('Error during speech recognition: ' + event.error);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -136,7 +136,7 @@
|
|||
static unique (url)
|
||||
{
|
||||
const parts = url.replace(/\?/g, '&').split('&'),
|
||||
full = parts[0];
|
||||
full = parts[0];
|
||||
|
||||
if (parts.length > 1) {
|
||||
parts.shift();
|
||||
|
|
|
|||
|
|
@ -87,7 +87,7 @@
|
|||
|
||||
let n = 0,
|
||||
pos = 0;
|
||||
|
||||
|
||||
while (true) {
|
||||
pos = str.indexOf(substr, pos);
|
||||
|
||||
|
|
@ -130,7 +130,7 @@
|
|||
const length = chars.length;
|
||||
let found = haystack.length;
|
||||
let min = haystack.length;
|
||||
|
||||
|
||||
for (let i = 0; i < length; ++i) {
|
||||
if ((found = haystack.indexOf(chars.charAt(i))) >= 0 && min > found) {
|
||||
min = found;
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ describe('EventManagerTest', function ()
|
|||
it('Testing default functionality', function ()
|
||||
{
|
||||
let manager = new jsOMS.Event.EventManager();
|
||||
|
||||
|
||||
expect(manager.hasOutstanding('invalid')).toBeFalsy(null);
|
||||
expect(manager.trigger('invalid')).toBeFalsy(null);
|
||||
expect(manager.count()).toBe(0);
|
||||
|
|
@ -19,7 +19,7 @@ describe('EventManagerTest', function ()
|
|||
it('Testing base functionality', function ()
|
||||
{
|
||||
let manager = new jsOMS.Event.EventManager();
|
||||
|
||||
|
||||
expect(manager.attach('group', function() { return true; }, false, false)).toBeTruthy();
|
||||
expect(manager.attach('group', function() { return true; }, false, false)).toBeFalsy();
|
||||
expect(manager.count()).toBe(1);
|
||||
|
|
@ -31,7 +31,7 @@ describe('EventManagerTest', function ()
|
|||
it('Testing reset functionality', function ()
|
||||
{
|
||||
let manager = new jsOMS.Event.EventManager();
|
||||
|
||||
|
||||
expect(manager.attach('group', function() { return true; }, false, true)).toBeTruthy();
|
||||
manager.addGroup('group', 'id1');
|
||||
manager.addGroup('group', 'id2');
|
||||
|
|
@ -48,7 +48,7 @@ describe('EventManagerTest', function ()
|
|||
it('Testing detach functionality', function ()
|
||||
{
|
||||
let manager = new jsOMS.Event.EventManager();
|
||||
|
||||
|
||||
expect(manager.attach('group', function() { return true; }, false, true)).toBeTruthy();
|
||||
manager.addGroup('group', 'id1');
|
||||
manager.addGroup('group', 'id2');
|
||||
|
|
@ -65,7 +65,7 @@ describe('EventManagerTest', function ()
|
|||
it('Testing remove functionality', function ()
|
||||
{
|
||||
let manager = new jsOMS.Event.EventManager();
|
||||
|
||||
|
||||
expect(manager.attach('group1', function() { return true; }, true, false)).toBeTruthy();
|
||||
expect(manager.attach('group2', function() { return true; }, true, false)).toBeTruthy();
|
||||
expect(manager.count()).toBe(2);
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ describe('NotificationManagerTest', function ()
|
|||
it('Testing default functionality', function ()
|
||||
{
|
||||
let manager = new jsOMS.Message.Notification.NotificationManager();
|
||||
|
||||
|
||||
expect(manager.getAppNotifier()).toEqual(jasmine.any(jsOMS.Message.Notification.App.AppNotification));
|
||||
expect(manager.getBrowserNotifier()).toEqual(jasmine.any(jsOMS.Message.Notification.Browser.BrowserNotification));
|
||||
});
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@ describe('NotificationMessageTest', function ()
|
|||
it('Testing default functionality', function ()
|
||||
{
|
||||
let msg = new jsOMS.Message.Notification.NotificationMessage('ok', 'abc', 'def');
|
||||
|
||||
|
||||
expect(msg.status).toBe('ok');
|
||||
expect(msg.title).toBe('abc');
|
||||
expect(msg.message).toBe('def');
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user