tradable/tradable-core

View on GitHub

Showing 49 of 55 total issues

Function modifyProtectedOrder has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

        modifyProtectedOrder : function (order, price, takeProfitPrice, stopLossPrice, currentBidOrAskPrice, resolve, reject) {
Severity: Major
Found in src/tradable.js - About 50 mins to fix

    Function placeOrder has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

            placeOrder : function (amount, price, side, instrumentId, type, resolve, reject){
    Severity: Major
    Found in src/tradable.js - About 50 mins to fix

      Function makeAccountRequest has 6 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              makeAccountRequest : function (type, accountId, method, postData, resolve, reject){
      Severity: Minor
      Found in src/tradable.js - About 45 mins to fix

        Function calculatePositionSize has 6 arguments (exceeds 4 allowed). Consider refactoring.
        Open

                calculatePositionSize : function(instrumentId, risk, riskIsMoney, stopLossInPips, pipValue, equity){
        Severity: Minor
        Found in src/tradable.js - About 45 mins to fix

          Function validateOrderParams has 6 arguments (exceeds 4 allowed). Consider refactoring.
          Open

                  validateOrderParams : function (type, side, price, currentBidOrAskPrice, takeProfitPrice, stopLossPrice) {
          Severity: Minor
          Found in src/tradable.js - About 45 mins to fix

            Function replacerListAsync has 6 arguments (exceeds 4 allowed). Consider refactoring.
            Open

            function replacerListAsync(match, p1, p2, p3, offset, string) {
            Severity: Minor
            Found in gulpFile.js - About 45 mins to fix

              Function replacerAsync has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function replacerAsync(match, p1, p2, p3, offset, string) {
              Severity: Minor
              Found in gulpFile.js - About 45 mins to fix

                Function authenticateWithCredentials has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        authenticateWithCredentials : function (brokerId, login, password, externalId, resolve, reject) {
                Severity: Minor
                Found in src/tradable.js - About 45 mins to fix

                  Function addOrModifyProtectionsForAccount has 6 arguments (exceeds 4 allowed). Consider refactoring.
                  Open

                          addOrModifyProtectionsForAccount : function (accountId, positionId, takeProfit, stopLoss, resolve, reject) {
                  Severity: Minor
                  Found in src/tradable.js - About 45 mins to fix

                    Function placeLimitOrder has 6 arguments (exceeds 4 allowed). Consider refactoring.
                    Open

                            placeLimitOrder : function (amount, price, side, instrumentId, resolve, reject){
                    Severity: Minor
                    Found in src/tradable.js - About 45 mins to fix

                      Function placeMarketOrderForAccount has 6 arguments (exceeds 4 allowed). Consider refactoring.
                      Open

                              placeMarketOrderForAccount : function (accountId, amount, side, instrumentId, resolve, reject){
                      Severity: Minor
                      Found in src/tradable.js - About 45 mins to fix

                        Function placeStopOrder has 6 arguments (exceeds 4 allowed). Consider refactoring.
                        Open

                                placeStopOrder : function (amount, price, side, instrumentId, resolve, reject){
                        Severity: Minor
                        Found in src/tradable.js - About 45 mins to fix

                          Function replacerSync has 6 arguments (exceeds 4 allowed). Consider refactoring.
                          Open

                          function replacerSync(match, p1, p2, p3, offset, string) {
                          Severity: Minor
                          Found in gulpFile.js - About 45 mins to fix

                            Function getCandles has 6 arguments (exceeds 4 allowed). Consider refactoring.
                            Open

                                    getCandles : function (instrumentId, from, to, aggregation, resolve, reject) {
                            Severity: Minor
                            Found in src/tradable.js - About 45 mins to fix

                              Function makeProtectionRequest has 6 arguments (exceeds 4 allowed). Consider refactoring.
                              Open

                                      makeProtectionRequest : function (method, positionId, newPrice, type, resolve, reject) {
                              Severity: Minor
                              Found in src/tradable.js - About 45 mins to fix

                                Consider simplifying this complex logical expression.
                                Open

                                            if((takeProfitPrice && side === "BUY" && takeProfitPrice < refPrice) ||
                                               (takeProfitPrice && side === "SELL" && takeProfitPrice > refPrice)) {
                                                throw "Take profit order is on the wrong side";
                                            }
                                Severity: Major
                                Found in src/tradable.js - About 40 mins to fix

                                  Consider simplifying this complex logical expression.
                                  Open

                                              if((stopLossPrice && side === "BUY" && stopLossPrice > refPrice) ||
                                                  (stopLossPrice && side === "SELL" && stopLossPrice < refPrice)) {
                                                  throw "Stop loss order is on the wrong side";
                                              }
                                  Severity: Major
                                  Found in src/tradable.js - About 40 mins to fix

                                    Function getOrderProtections has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                    Open

                                            getOrderProtections : function(accountId, instrumentId, takeProfitPrice, stopLossPrice, priceForDistance) {
                                    Severity: Minor
                                    Found in src/tradable.js - About 35 mins to fix

                                      Function reducePositionToAmountForAccount has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                      Open

                                              reducePositionToAmountForAccount : function (accountId, positionId, newAmount, resolve, reject){
                                      Severity: Minor
                                      Found in src/tradable.js - About 35 mins to fix

                                        Function addOrModifyStopLossForAccount has 5 arguments (exceeds 4 allowed). Consider refactoring.
                                        Open

                                                addOrModifyStopLossForAccount : function (accountId, positionId, newPrice, resolve, reject) {
                                        Severity: Minor
                                        Found in src/tradable.js - About 35 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language