Showing 49 of 55 total issues
Function addOrModifyTakeProfitForAccount
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
addOrModifyTakeProfitForAccount : function (accountId, positionId, newPrice, resolve, reject) {
Function getOrderProtections
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
getOrderProtections : function(accountId, instrumentId, takeProfitPrice, stopLossPrice, priceForDistance) {
Function makeCandleRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
makeCandleRequest : function (method, insIdsArray, resolve, reject, postObject) {
Function placeMarketOrder
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
placeMarketOrder : function (amount, side, instrumentId, resolve, reject){
Function addOrModifyStopLossForAccount
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
addOrModifyStopLossForAccount : function (accountId, positionId, newPrice, resolve, reject) {
Function modifyOrderPriceForAccount
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
modifyOrderPriceForAccount : function (accountId, orderId, newPrice, resolve, reject){
Function reducePositionToAmountForAccount
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
reducePositionToAmountForAccount : function (accountId, positionId, newAmount, resolve, reject){
Function initializeWithToken
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
Open
initializeWithToken : function(access_token, end_point, expires_in, resolve, reject) {
Function getJSONTemplateForObject
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
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
- Read upRead up
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"