From ac2ad7fc81b2e883f3b4931a8a33717ad6316431 Mon Sep 17 00:00:00 2001 From: Roxanne Skelly Date: Tue, 25 Sep 2018 14:06:09 -0700 Subject: [PATCH] Fix some coding standard issues found during CR --- server-console/src/modules/hf-acctinfo.js | 28 +++++++++++------------ server-console/src/modules/hf-process.js | 6 ++--- 2 files changed, 17 insertions(+), 17 deletions(-) diff --git a/server-console/src/modules/hf-acctinfo.js b/server-console/src/modules/hf-acctinfo.js index ba12e6a5ce..828bc781b8 100644 --- a/server-console/src/modules/hf-acctinfo.js +++ b/server-console/src/modules/hf-acctinfo.js @@ -35,8 +35,8 @@ function AccountInfo() { AccountInfo.prototype = { - accessToken: function(metaverseUrl) { - if(this.data && this.data[metaverseUrl] && this.data[metaverseUrl]["accessToken"]) { + accessToken: function (metaverseUrl) { + if (this.data && this.data[metaverseUrl] && this.data[metaverseUrl]["accessToken"]) { return this.data[metaverseUrl]["accessToken"]["token"]; } return null; @@ -49,24 +49,24 @@ AccountInfo.prototype = { this.parseOffset += 4; return result; }, - _parseMap: function() { + _parseMap: function () { var result = {}; var n = this._parseUInt32(); - for(var i = 0; i < n; i++) { + for (var i = 0; i < n; i++) { var key = this._parseQString(); result[key] = this._parseVariant(); } return result; }, - _parseVariant: function() { + _parseVariant: function () { var varType = this._parseUInt32(); var isNull = this.rawData[this.parseOffset++]; - switch(varType) { + switch (varType) { case VariantTypes.USER_TYPE: //user type var userTypeName = this._parseByteArray().toString('ascii').slice(0,-1); - if(userTypeName == "DataServerAccountInfo") { + if (userTypeName == "DataServerAccountInfo") { return this._parseDataServerAccountInfo(); } else { @@ -75,7 +75,7 @@ AccountInfo.prototype = { break; } }, - _parseByteArray: function() { + _parseByteArray: function () { var length = this._parseUInt32(); if (length == 0xffffffff) { return null; @@ -85,17 +85,17 @@ AccountInfo.prototype = { return result; }, - _parseQString: function() { + _parseQString: function () { if (!this.rawData || (this.rawData.length <= this.parseOffset)) { throw "Expected QString"; } // length in bytes; var length = this._parseUInt32(); - if(length == 0xFFFFFFFF) { + if (length == 0xFFFFFFFF) { return null; } - if(this.rawData.length - this.parseOffset < length) { + if (this.rawData.length - this.parseOffset < length) { throw "Insufficient buffer length for QString parsing"; } @@ -106,7 +106,7 @@ AccountInfo.prototype = { this.parseOffset += length; return result; }, - _parseDataServerAccountInfo: function() { + _parseDataServerAccountInfo: function () { return { accessToken: this._parseOAuthAccessToken(), username: this._parseQString(), @@ -120,7 +120,7 @@ AccountInfo.prototype = { } }, - _parseOAuthAccessToken: function() { + _parseOAuthAccessToken: function () { return { token: this._parseQString(), timestampHigh: this._parseUInt32(), @@ -129,7 +129,7 @@ AccountInfo.prototype = { refreshToken: this._parseQString() } }, - _parseUUID: function() { + _parseUUID: function () { this.parseOffset += 16; return null; } diff --git a/server-console/src/modules/hf-process.js b/server-console/src/modules/hf-process.js index 7fbc9a894e..dca97d1eed 100644 --- a/server-console/src/modules/hf-process.js +++ b/server-console/src/modules/hf-process.js @@ -259,12 +259,12 @@ Process.prototype = extend(Process.prototype, { }; return logs; }, - isRunning: function(done) { + isRunning: function (done) { var _command = this.command; if (os.type == 'Windows_NT') { - childProcess.exec('tasklist /FO CSV', function(err, stdout, stderr) { + childProcess.exec('tasklist /FO CSV', function (err, stdout, stderr) { var running = false; - stdout.split("\n").forEach(function(line) { + stdout.split("\n").forEach(function (line) { var exeData = line.split(","); var executable = exeData[0].replace(/\"/g, "").toLowerCase(); if(executable == _command) {