tradable/tradable-core

View on GitHub

Showing 49 of 55 total issues

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

        addOrModifyTakeProfitForAccount : function (accountId, positionId, newPrice, resolve, reject) {
Severity: Minor
Found in src/tradable.js - About 35 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 makeCandleRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              makeCandleRequest : function (method, insIdsArray, resolve, reject, postObject) {
      Severity: Minor
      Found in src/tradable.js - About 35 mins to fix

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

                placeMarketOrder : function (amount, side, instrumentId, 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

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

                    modifyOrderPriceForAccount : function (accountId, orderId, newPrice, resolve, reject){
            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 initializeWithToken has 5 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                        initializeWithToken : function(access_token, end_point, expires_in, resolve, reject) {
                Severity: Minor
                Found in src/tradable.js - About 35 mins to fix

                  Function getJSONTemplateForObject has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                  Open

                  function getJSONTemplateForObject(objName, list) {
                      for(i = 0 ; i < apiJsonArray.length ; i++) {
                          if(apiJsonArray[i].name === objName) {
                              var jsonObj = apiJsonArray[i].jsondocTemplate;
                              return (list) ? [jsonObj] : jsonObj; // Print the json response
                  Severity: Minor
                  Found in gulpFile.js - About 25 mins to fix

                  Cognitive Complexity

                  Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                  A method's cognitive complexity is based on a few simple rules:

                  • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                  • Code is considered more complex for each "break in the linear flow of the code"
                  • Code is considered more complex when "flow breaking structures are nested"

                  Further reading

                  Severity
                  Category
                  Status
                  Source
                  Language