diff --git a/detekt-baseline.xml b/detekt-baseline.xml index e617e2453..a0f973dcd 100644 --- a/detekt-baseline.xml +++ b/detekt-baseline.xml @@ -2,177 +2,6 @@ - ComplexCondition:Account.kt$Subaccount.Companion$existing?.positionId != positionId || existing?.pnlTotal != pnlTotal || existing?.pnl24h != pnl24h || existing?.pnl24hPercent != pnl24hPercent || existing?.quoteBalance !== quoteBalance || existing.notionalTotal !== notionalTotal || existing.valueTotal !== valueTotal || existing.initialRiskTotal !== initialRiskTotal || existing.adjustedImf !== adjustedImf || existing.equity !== equity || existing.freeCollateral !== freeCollateral || existing.leverage !== leverage || existing.marginUsage !== marginUsage || existing.buyingPower !== buyingPower || existing.openPositions != openPositions || existing.pendingPositions != pendingPositions || existing.orders != orders || existing.marginEnabled != marginEnabled - ComplexCondition:Account.kt$SubaccountFill.Companion$existing?.id != id || existing.marketId != marketId || existing.orderId != orderId || existing.side !== side || existing.type !== type || existing.liquidity !== liquidity || existing.price != price || existing.fee != fee || existing.createdAtMilliseconds != createdAtMilliseconds || existing.resources !== resources - ComplexCondition:Account.kt$SubaccountFill.Companion$id != null && marketId != null && side != null && type != null && liquidity != null && price != null && size != null && createdAtMilliseconds != null && resources != null - ComplexCondition:Account.kt$SubaccountFillResources.Companion$existing?.sideStringKey != sideStringKey || existing?.liquidityStringKey != liquidityStringKey || existing?.typeStringKey != typeStringKey || existing?.iconLocal != iconLocal - ComplexCondition:Account.kt$SubaccountFundingPayment.Companion$existing?.marketId != marketId || existing.payment != payment || existing.rate != rate || existing.positionSize != positionSize || existing.price != price || existing.effectiveAtMilliSeconds != effectiveAtMilliSeconds - ComplexCondition:Account.kt$SubaccountFundingPayment.Companion$marketId != null && payment != null && rate != null && positionSize != null && effectiveAtMilliSeconds != null - ComplexCondition:Account.kt$SubaccountHistoricalPNL.Companion$equity != null && totalPnl != null && netTransfers != null && createdAtMilliseconds != null - ComplexCondition:Account.kt$SubaccountHistoricalPNL.Companion$existing?.equity != equity || existing.totalPnl != totalPnl || existing.netTransfers != netTransfers || existing.createdAtMilliseconds != createdAtMilliseconds - ComplexCondition:Account.kt$SubaccountOrder.Companion$existing?.subaccountNumber != subaccountNumber || existing.id != id || existing.clientId != clientId || existing.type !== type || existing.side !== side || existing.status !== status || existing.timeInForce !== timeInForce || existing.marketId != marketId || existing.clobPairId != clobPairId || existing.orderFlags != orderFlags || existing.price != price || existing.triggerPrice != triggerPrice || existing.trailingPercent != trailingPercent || existing.size != size || existing.remainingSize != remainingSize || existing.totalFilled != totalFilled || existing.goodTilBlock != goodTilBlock || existing.goodTilBlockTime != goodTilBlockTime || existing.createdAtMilliseconds != createdAtMilliseconds || existing.unfillableAtMilliseconds != unfillableAtMilliseconds || existing.expiresAtMilliseconds != expiresAtMilliseconds || existing.updatedAtMilliseconds != updatedAtMilliseconds || existing.postOnly != postOnly || existing.reduceOnly != reduceOnly || existing.cancelReason != cancelReason || existing.resources !== resources - ComplexCondition:Account.kt$SubaccountOrder.Companion$id != null && marketId != null && type != null && side != null && status != null && price != null && size != null && resources != null - ComplexCondition:Account.kt$SubaccountOrderResources.Companion$existing?.sideStringKey != sideStringKey || existing.typeStringKey != typeStringKey || existing.statusStringKey != statusStringKey || existing.timeInForceStringKey != timeInForceStringKey - ComplexCondition:Account.kt$SubaccountPendingPosition.Companion$existing?.assetId != assetId || existing.firstOrderId != firstOrderId || existing.orderCount != orderCount || existing.freeCollateral !== freeCollateral || existing.quoteBalance !== quoteBalance || existing.equity !== equity - ComplexCondition:Account.kt$SubaccountPosition.Companion$existing?.id != id || existing.assetId != assetId || existing.entryPrice !== entryPrice || existing.exitPrice != exitPrice || existing.createdAtMilliseconds != createdAtMilliseconds || existing.closedAtMilliseconds != closedAtMilliseconds || existing.netFunding != netFunding || existing.realizedPnl !== realizedPnl || existing.realizedPnlPercent !== realizedPnlPercent || existing.unrealizedPnl !== unrealizedPnl || existing.unrealizedPnlPercent !== unrealizedPnlPercent || existing.size !== size || existing.notionalTotal !== notionalTotal || existing.valueTotal !== valueTotal || existing.initialRiskTotal !== initialRiskTotal || existing.adjustedImf !== adjustedImf || existing.adjustedMmf !== adjustedMmf || existing.leverage !== leverage || existing.maxLeverage !== maxLeverage || existing.buyingPower !== buyingPower || existing.liquidationPrice !== liquidationPrice || existing.resources !== resources || existing.childSubaccountNumber !== childSubaccountNumber || existing.freeCollateral !== freeCollateral || existing.quoteBalance !== quoteBalance || existing.equity !== equity - ComplexCondition:Account.kt$SubaccountTransfer.Companion$existing?.id != id || existing.type !== type || existing.asset != asset || existing.amount != amount || existing.updatedAtBlock != updatedAtBlock || existing.updatedAtMilliseconds != updatedAtMilliseconds || existing.fromAddress != fromAddress || existing.toAddress != toAddress || existing.transactionHash != transactionHash || existing.resources !== resources - ComplexCondition:Account.kt$SubaccountTransferResources.Companion$existing?.typeStringKey != typeStringKey || existing?.blockExplorerUrl != blockExplorerUrl || existing?.statusStringKey != statusStringKey || existing?.iconLocal != iconLocal || existing?.indicator != indicator - ComplexCondition:Account.kt$TradeStatesWithPositionSides.Companion$existing == null || existing.current !== current || existing.postOrder !== postOrder || existing.postAllOrders !== postAllOrders - ComplexCondition:AccountSupervisor.kt$AccountSupervisor$url != null && fromChain != null && fromToken != null && nobleAddress != null && chainId != null && dydxTokenDemon != null && squidIntegratorId != null - ComplexCondition:Asset.kt$Asset.Companion$existing?.id != id || existing.name != name || existing.tags != tags || existing.resources !== resources - ComplexCondition:Asset.kt$AssetResources.Companion$existing?.websiteLink != websiteLink || existing?.whitepaperLink != whitepaperLink || existing?.coinMarketCapsLink != coinMarketCapsLink || existing?.imageUrl != imageUrl || existing?.primaryDescriptionKey != primaryDescriptionKey || existing?.secondaryDescriptionKey != secondaryDescriptionKey - ComplexCondition:BaseProcessor.kt$BaseProcessor$firstIncomingTime != null && lastExisting != null && firstIncomingTime != lastExisting && ascending( firstIncomingTime, lastExisting, ) != ascending - ComplexCondition:BaseProcessor.kt$BaseProcessor$lastIncomingTime != null && firstExisting != null && lastIncomingTime != firstExisting && ascending( lastIncomingTime, firstExisting, ) == ascending - ComplexCondition:ClosePositionInput.kt$ClosePositionInput.Companion$existing?.type !== type || existing?.side !== side || existing?.marketId != marketId || existing?.size !== size || existing?.price !== price || existing?.fee != fee || existing?.marketOrder !== marketOrder || existing?.summary !== summary - ComplexCondition:ClosePositionInput.kt$ClosePositionInputSize.Companion$existing?.size != size || existing?.usdcSize != usdcSize || existing?.percent != percent || existing?.input != input - ComplexCondition:Configs.kt$FeeDiscount.Companion$existing?.id != id || existing.tier != tier || existing.symbol != symbol || existing.balance != balance || existing.discount != discount || existing.resources !== resources - ComplexCondition:Configs.kt$FeeDiscount.Companion$id != null && tier != null && symbol != null && balance != null - ComplexCondition:Configs.kt$FeeTier.Companion$existing?.id != id || existing.tier != tier || existing.symbol != symbol || existing.volume != volume || existing.makerShare != makerShare || existing.totalShare != totalShare || existing.maker != maker || existing.taker != taker || existing.resources !== resources - ComplexCondition:Configs.kt$FeeTier.Companion$id != null && tier != null && symbol != null && volume != null - ComplexCondition:ConnectionStats.kt$ConnectionStats$apiState?.status != status || apiState.height != block || apiState.haltedBlock != haltedBlock || apiState.trailingBlocks != blockDiff - ComplexCondition:Input.kt$Input.Companion$existing?.current !== current || existing?.trade !== trade || existing?.closePosition !== closePosition || existing?.transfer !== transfer || existing?.triggerOrders !== triggerOrders || existing?.receiptLines != receiptLines || existing?.errors != errors - ComplexCondition:Market.kt$MarketCandle.Companion$existing?.startedAtMilliseconds != startedAtMilliseconds || existing.trades != trades || existing.updatedAtMilliseconds != updatedAtMilliseconds || existing.low != low || existing.high != high || existing.open != open || existing.close != close || existing.baseTokenVolume != baseTokenVolume || existing.usdVolume != usdVolume - ComplexCondition:Market.kt$MarketCandle.Companion$startedAtMilliseconds != null && low != null && high != null && open != null && close != null && baseTokenVolume != null && usdVolume != null - ComplexCondition:Market.kt$MarketConfigs.Companion$existing == null || existing.largeSize != largeSize || existing.stepSize != stepSize || existing.tickSize != tickSize || existing.displayStepSize != displayStepSize || existing.displayTickSize != displayTickSize || existing.minOrderSize != minOrderSize || existing.initialMarginFraction != initialMarginFraction || existing.maintenanceMarginFraction != maintenanceMarginFraction || existing.incrementalInitialMarginFraction != incrementalInitialMarginFraction || existing.incrementalPositionSize != incrementalPositionSize || existing.maxPositionSize != maxPositionSize || existing.baselinePositionSize != baselinePositionSize || existing.basePositionNotional != basePositionNotional || existing.candleOptions != candleOptions || existing.perpetualMarketType != perpetualMarketType || existing.v4 != v4 - ComplexCondition:Market.kt$MarketConfigsV4.Companion$existing == null || existing.clobPairId != clobPairId || existing.atomicResolution != atomicResolution || existing.stepBaseQuantums != stepBaseQuantums || existing.quantumConversionExponent != quantumConversionExponent || existing.subticksPerTick != subticksPerTick - ComplexCondition:Market.kt$MarketOrderbook.Companion$existing?.midPrice != midPrice || existing?.spreadPercent != spreadPercent || existing?.grouping !== grouping || existing?.asks != asks || existing?.bids != bids - ComplexCondition:Market.kt$MarketPerpetual.Companion$existing?.openInterest != openInterest || existing.openInterestUSDC != openInterestUSDC || existing.volume24H != volume24H || existing.trades24H != trades24H || existing.nextFundingRate != nextFundingRate || existing.nextFundingAtMilliseconds != nextFundingAtMilliseconds || existing.line != line - ComplexCondition:Market.kt$MarketTrade.Companion$existing?.id != id || existing?.size != size || existing.side !== side || existing.price != price || existing.type != type || existing.createdAtMilliseconds != createdAtMilliseconds || existing.resources !== resources - ComplexCondition:Market.kt$MarketTrade.Companion$size != null && price != null && createdAtMilliseconds != null && resources != null - ComplexCondition:Market.kt$OrderbookLine.Companion$existing?.size != size || existing.price != price || existing.offset != offset || existing.depth != depth || existing.depthCost != depthCost - ComplexCondition:OnboardingSupervisor.kt$OnboardingSupervisor$fromChain != null && fromToken != null && fromAmount != null && fromAmount > 0 && fromAmountString != null && chainId != null && dydxTokenDemon != null && url != null && squidIntegratorId != null - ComplexCondition:OnboardingSupervisor.kt$OnboardingSupervisor$fromChain != null && fromToken != null && fromAmount != null && fromAmount > 0 && fromAmountString != null && nobleAddress != null && chainId != null && dydxTokenDemon != null && url != null && squidIntegratorId != null && toChain != null && toToken != null - ComplexCondition:OnboardingSupervisor.kt$OnboardingSupervisor$name != null && label != null && icon != null && depositType != null - ComplexCondition:OnboardingSupervisor.kt$OnboardingSupervisor$nobleChain != null && nobleToken != null && toAddress != null && fromAmount != null && fromAmount > 0 && fromAmountString != null && chainId != null && dydxTokenDemon != null && url != null && squidIntegratorId != null - ComplexCondition:OnboardingSupervisor.kt$OnboardingSupervisor$toChain != null && toToken != null && toAddress != null && fromAmount != null && fromAmount > 0 && fromAmountString != null && chainId != null && dydxTokenDemon != null && url != null && fromAddress != null && squidIntegratorId != null && fromChain != null && fromToken != null - ComplexCondition:OnboardingSupervisor.kt$OnboardingSupervisor$toChain != null && toToken != null && toAddress != null && fromAmount != null && fromAmount > 0 && fromAmountString != null && chainId != null && dydxTokenDemon != null && url != null && squidIntegratorId != null - ComplexCondition:OnboardingSupervisor.kt$OnboardingSupervisor$type == TransferInputField.usdcSize || type == TransferInputField.address || type == TransferInputField.chain || type == TransferInputField.exchange || type == TransferInputField.token - ComplexCondition:OnboardingSupervisor.kt$OnboardingSupervisor$type == TransferInputField.usdcSize || type == TransferInputField.size || type == TransferInputField.token || type == TransferInputField.address - ComplexCondition:OnboardingSupervisor.kt$OnboardingSupervisor$url != null && fromChain != null && fromToken != null && nobleAddress != null && chainId != null && dydxTokenDemon != null && squidIntegratorId != null - ComplexCondition:OnboardingSupervisor.kt$OnboardingSupervisor$url != null && nobleChain != null && nobleToken != null && nobleAddress != null && chainId != null && dydxTokenDemon != null && squidIntegratorId != null && fromAmountString != null && fromAmount != null && fromAmount > 0 - ComplexCondition:OrderbookEntryProcessor.kt$OrderbookEntryProcessor$(offset == null && size > 0.0) || (offset != null && offset > oldOffset) - ComplexCondition:OrderbookProcessor.kt$OrderbookProcessor$asks != null && bids != null && asks.size > 0 && bids.size > 0 - ComplexCondition:Parser.kt$Parser$string == "n" || string == "0" || string == "false" || string == "no" || string == "off" - ComplexCondition:Parser.kt$Parser$string == "y" || string == "1" || string == "true" || string == "yes" || string == "on" - ComplexCondition:SystemSupervisor.kt$SystemSupervisor$stateMachine.featureFlags.withdrawalSafetyEnabled && configs.retrieveWithdrawSafetyChecks && (transferType == TransferType.withdrawal || transferType == TransferType.transferOut) - ComplexCondition:TradeAccountStateValidator.kt$TradeAccountStateValidator$equity != null && ( equity == Numeric.double.ZERO || marginUsage == null || marginUsage < Numeric.double.ZERO || marginUsage > Numeric.double.ONE ) - ComplexCondition:TradeInput.kt$SelectionOption.Companion$existing?.type != type || existing.string != string || existing.stringKey != stringKey || existing.iconUrl != iconUrl - ComplexCondition:TradeInput.kt$TradeInput.Companion$existing?.type != type || existing?.side != side || existing?.marketId != marketId || existing?.size != size || existing?.price != price || existing?.timeInForce != timeInForce || existing?.goodTil != goodTil || existing?.execution != execution || existing?.reduceOnly != reduceOnly || existing.postOnly != postOnly || existing.fee != fee || existing?.marginMode != marginMode || existing?.targetLeverage != targetLeverage || existing.bracket != bracket || existing.marketOrder != marketOrder || existing.options != options || existing.summary != summary - ComplexCondition:TradeInput.kt$TradeInputBracket.Companion$existing?.stopLoss != stopLoss || existing?.takeProfit != takeProfit || existing?.goodTil != goodTil || existing?.execution != execution - ComplexCondition:TradeInput.kt$TradeInputMarketOrder.Companion$existing?.size != size || existing?.usdcSize != usdcSize || existing?.price != price || existing?.worstPrice != worstPrice || existing?.filled != filled || existing.orderbook != orderbook - ComplexCondition:TradeInput.kt$TradeInputOptions.Companion$existing?.needsSize != needsSize || existing.needsLeverage != needsLeverage || existing.maxLeverage != maxLeverage || existing.needsLimitPrice != needsLimitPrice || existing.needsTargetLeverage != needsTargetLeverage || existing.needsTriggerPrice != needsTriggerPrice || existing.needsTrailingPercent != needsTrailingPercent || existing.needsGoodUntil != needsGoodUntil || existing.needsReduceOnly != needsReduceOnly || existing.needsPostOnly != needsPostOnly || existing.needsBrackets != needsBrackets || existing.timeInForceOptions != timeInForceOptionsArray || existing.marginModeOptions != marginModeOptions || existing.executionOptions != executionOptionsArray || existing.reduceOnlyTooltip != reduceOnlyTooltip - ComplexCondition:TradeInput.kt$TradeInputSize.Companion$existing?.size != size || existing?.usdcSize != usdcSize || existing?.leverage != leverage || existing?.input != input - ComplexCondition:TradeInput.kt$TradeInputSummary.Companion$existing?.price != price || existing?.payloadPrice != payloadPrice || existing?.size != size || existing?.usdcSize != usdcSize || existing?.slippage != slippage || existing?.fee != fee || existing?.total != total || existing?.positionMargin != positionMargin || existing?.positionLeverage != positionLeverage || existing?.filled != filled - ComplexCondition:TradeInputCalculator.kt$TradeInputCalculator$fee != null && feeMultiplierPpm != null && tokenPrice != null && tokenPriceExponent != null && fee > 0.0 && notional != null && tokenPrice > 0.0 - ComplexCondition:TradeInputCalculator.kt$TradeInputCalculator$fee != null && feeMultiplierPpm != null && tokenPrice != null && tokenPriceExponent != null && fee > 0.0 && tokenPrice > 0.0 - ComplexCondition:TradeInputCalculator.kt$TradeInputCalculator$price != null && usdcSize != null && usdcSize > Numeric.double.ZERO && price > Numeric.double.ZERO - ComplexCondition:TradeInputDataValidator.kt$TradeInputDataValidator$!isShortTermAndRequiresImmediateExecution && (status == "OPEN" || status == "PENDING" || status == "UNTRIGGERED" || status == "PARTIALLY_FILLED") && (isCurrentOrderStateful == shouldCountStatefulOrders) - ComplexCondition:TradingStateMachine+Wallet.kt$payload["accounts"] != null || payload["subaccounts"] != null || payload["positions"] != null || payload["perpetualPositions"] != null || payload["assetPositions"] != null || payload["orders"] != null - ComplexCondition:TradingStates.kt$TradeStatesWithDoubleValues.Companion$existing == null || existing.current != current || existing.postOrder != postOrder || existing.postAllOrders != postAllOrders - ComplexCondition:TradingStates.kt$TradeStatesWithStringValues.Companion$existing == null || existing.current != current || existing.postOrder != postOrder || existing.postAllOrders != postAllOrders - ComplexCondition:TransferInput.kt$DepositInputOptions.Companion$existing?.needsSize != needsSize || existing?.needsAddress != needsAddress || existing?.needsFastSpeed != needsFastSpeed || existing?.chains != chains || existing?.assets != assets - ComplexCondition:TransferInput.kt$TransferInput.Companion$existing?.type !== type || existing?.size !== size || existing?.fastSpeed != fastSpeed || existing.fee != fee || existing.exchange != exchange || existing.chain != chain || existing.token != token || existing.address != address || existing.depositOptions != depositOptions || existing.withdrawalOptions != withdrawalOptions || existing.transferOutOptions != transferOutOptions || existing.summary !== summary || existing.resources !== resources || existing.requestPayload !== requestPayload || existing.errors != errors || existing.errorMessage != errorMessage - ComplexCondition:TransferInput.kt$TransferInputChainResource.Companion$existing?.chainName != chainName || existing?.rpc != rpc || existing?.networkName != networkName || existing?.chainId != chainId || existing?.iconUrl != iconUrl - ComplexCondition:TransferInput.kt$TransferInputRequestPayload.Companion$existing?.routeType != routeType || existing?.targetAddress != targetAddress || existing?.data != dataValue || existing?.value != value || existing?.gasLimit != gasLimit || existing?.gasPrice != gasPrice || existing?.maxFeePerGas != maxFeePerGas || existing?.maxPriorityFeePerGas != maxPriorityFeePerGas || existing?.fromChainId != fromChainId || existing?.toChainId != toChainId || existing?.fromAddress != fromAddress || existing?.toAddress != toAddress || existing?.isV2Route != isV2Route || existing?.requestId != requestId - ComplexCondition:TransferInput.kt$TransferInputSummary.Companion$existing?.usdcSize != usdcSize || existing?.fee != fee || existing?.filled != filled || existing.slippage != slippage || existing.exchangeRate != exchangeRate || existing.estimatedRouteDuration != estimatedRouteDuration || existing.bridgeFee != bridgeFee || existing.gasFee != gasFee || existing.toAmount != toAmount || existing.toAmountMin != toAmountMin || existing.toAmountUSDC != toAmountUSDC || existing.aggregatePriceImpact != aggregatePriceImpact - ComplexCondition:TransferInput.kt$TransferInputTokenResource.Companion$existing?.name != name || existing?.address != address || existing?.symbol != symbol || existing?.decimals != decimals || existing?.iconUrl != iconUrl - ComplexCondition:TransferInput.kt$TransferOutInputOptions.Companion$existing?.needsSize != needsSize || existing.needsAddress != needsAddress || existing.chains != chains || existing.assets != assets - ComplexCondition:TransferInput.kt$WithdrawalInputOptions.Companion$existing?.needsSize != needsSize || existing?.needsAddress != needsAddress || existing?.needsFastSpeed != needsFastSpeed || existing?.chains != chains || existing?.assets != assets - ComplexCondition:TransferStatus.kt$TransferRouteStatus.Companion$existing == null || existing.chainId != chainId || existing.txHash != txHash || existing.status != status || existing.action != action - ComplexCondition:TransferStatus.kt$TransferStatus.Companion$existing == null || existing.status != status || existing.gasStatus != gasStatus || existing.axelarTransactionUrl != axelarTransactionUrl || existing.fromChainStatus != fromChainStatus || existing.toChainStatus != toChainStatus || existing.routeStatuses != routeStatuses || existing.error != error || existing.squidTransactionStatus != squidTransactionStatus - ComplexCondition:TriggerOrdersInput.kt$TriggerOrder.Companion$existing?.orderId != orderId || existing?.size != size || existing?.type != type || existing?.side != side || existing?.price != price || existing?.summary != summary - ComplexCondition:TriggerOrdersInput.kt$TriggerOrdersInput.Companion$existing?.marketId != marketId || existing?.size != size || existing?.stopLossOrder != stopLossOrder || existing?.takeProfitOrder != takeProfitOrder - ComplexCondition:TriggerOrdersInput.kt$TriggerPrice.Companion$existing?.limitPrice != limitPrice || existing?.triggerPrice != triggerPrice || existing?.percentDiff != percentDiff || existing?.usdcDiff != usdcDiff || existing?.input != input - ComplexCondition:TriggerOrdersInputCalculator.kt$TriggerOrdersInputCalculator$size == null || size == Numeric.double.ZERO || notionalTotal == Numeric.double.ZERO || leverage == Numeric.double.ZERO - ComplexCondition:TriggerOrdersInputValidator.kt$TriggerOrdersInputValidator$triggerPrice != null && triggerPrice <= 0 || (limitPrice != null && limitPrice <= 0) - ComplexCondition:V4StateManagerAdaptor+Transfer.kt$fromChain != null && fromToken != null && fromAmount != null && fromAmount > 0 && fromAmountString != null && accountAddress != null && chainId != null && dydxTokenDemon != null && url != null && sourceAddress != null && squidIntegratorId != null - ComplexCondition:V4StateManagerAdaptor+Transfer.kt$fromChain != null && fromToken != null && fromAmount != null && fromAmount > 0 && fromAmountString != null && nobleAddress != null && chainId != null && dydxTokenDemon != null && url != null && sourceAddress != null && squidIntegratorId != null && toChain != null && toToken != null - ComplexCondition:V4StateManagerAdaptor+Transfer.kt$name != null && label != null && icon != null && depositType != null - ComplexCondition:V4StateManagerAdaptor+Transfer.kt$nobleChain != null && nobleToken != null && toAddress != null && fromAmount != null && fromAmount > 0 && fromAmountString != null && accountAddress != null && chainId != null && dydxTokenDemon != null && url != null && fromAddress != null && squidIntegratorId != null - ComplexCondition:V4StateManagerAdaptor+Transfer.kt$toChain != null && toToken != null && toAddress != null && fromAmount != null && fromAmount > 0 && fromAmountString != null && accountAddress != null && chainId != null && dydxTokenDemon != null && url != null && fromAddress != null && squidIntegratorId != null - ComplexCondition:V4StateManagerAdaptor+Transfer.kt$toChain != null && toToken != null && toAddress != null && fromAmount != null && fromAmount > 0 && fromAmountString != null && accountAddress != null && chainId != null && dydxTokenDemon != null && url != null && fromAddress != null && squidIntegratorId != null && fromChain != null && fromToken != null - ComplexCondition:V4StateManagerAdaptor+Transfer.kt$url != null && fromChain != null && fromToken != null && nobleAddress != null && chainId != null && dydxTokenDemon != null && squidIntegratorId != null - ComplexCondition:V4StateManagerAdaptor+Transfer.kt$url != null && nobleChain != null && nobleToken != null && nobleAddress != null && chainId != null && dydxTokenDemon != null && squidIntegratorId != null && fromAmountString != null && fromAmount != null && fromAmount > 0 - ComplexCondition:V4StateManagerAdaptor.kt$V4StateManagerAdaptor$apiState?.status != status || apiState.height != block || apiState.haltedBlock != haltedBlock || apiState.trailingBlocks != blockDiff - ComplexCondition:V4StateManagerAdaptor.kt$V4StateManagerAdaptor$type == TransferInputField.usdcSize || type == TransferInputField.address || type == TransferInputField.chain || type == TransferInputField.exchange || type == TransferInputField.token - ComplexCondition:V4StateManagerAdaptor.kt$V4StateManagerAdaptor$type == TransferInputField.usdcSize || type == TransferInputField.size || type == TransferInputField.token || type == TransferInputField.address - ComplexCondition:ValidationError.kt$ValidationError.Companion$existing?.code != code || existing.type !== type || existing.fields != fields || existing.resources !== resources - ComplexCondition:Wallet.kt$User.Companion$existing?.isRegistered != isRegistered || existing.email != email || existing.username != username || existing.feeTierId != feeTierId || existing.makerFeeRate != makerFeeRate || existing.takerFeeRate != takerFeeRate || existing.makerVolume30D != makerVolume30D || existing.takerVolume30D != takerVolume30D || existing.fees30D != fees30D || existing.isEmailVerified != isEmailVerified || existing.country != country || existing.favorited != favorited || existing.walletId != walletId - CyclomaticComplexMethod:Account.kt$Account.Companion$internal fun create( existing: Account?, parser: ParserProtocol, data: Map<String, Any>, tokensInfo: Map<String, TokenInfo>, localizer: LocalizerProtocol?, ): Account - CyclomaticComplexMethod:Account.kt$Subaccount.Companion$internal fun create( existing: Subaccount?, parser: ParserProtocol, data: Map<*, *>?, localizer: LocalizerProtocol?, ): Subaccount? - CyclomaticComplexMethod:Account.kt$SubaccountFill.Companion$internal fun create( existing: SubaccountFill?, parser: ParserProtocol, data: Map<*, *>?, localizer: LocalizerProtocol?, ): SubaccountFill? - CyclomaticComplexMethod:Account.kt$SubaccountOrder.Companion$internal fun create( existing: SubaccountOrder?, parser: ParserProtocol, data: Map<*, *>?, localizer: LocalizerProtocol?, ): SubaccountOrder? - CyclomaticComplexMethod:Account.kt$SubaccountPosition.Companion$internal fun create( existing: SubaccountPosition?, parser: ParserProtocol, data: Map<String, Any>?, ): SubaccountPosition? - CyclomaticComplexMethod:Account.kt$SubaccountTransfer.Companion$internal fun create( existing: SubaccountTransfer?, parser: ParserProtocol, data: Map<*, *>?, ): SubaccountTransfer? - CyclomaticComplexMethod:Account.kt$TradingRewards.Companion$private fun createHistoricalTradingRewardsPerPeriod( objs: IList<HistoricalTradingReward>?, data: List<Any>?, parser: ParserProtocol, period: String, ): IList<HistoricalTradingReward> - CyclomaticComplexMethod:AsyncAbacusStateManager.kt$AsyncAbacusStateManager$private fun parseEnvironments(response: String): Boolean - CyclomaticComplexMethod:AsyncAbacusStateManagerV2.kt$AsyncAbacusStateManagerV2$private fun parseEnvironments(response: String): Boolean - CyclomaticComplexMethod:BaseInputValidator.kt$BaseInputValidator$private fun formatParam(params: Map<String, Any>): String? - CyclomaticComplexMethod:Bech32.kt$Bech32$fun decode(str: String): Bech32Data - CyclomaticComplexMethod:Configs.kt$FeeTier.Companion$internal fun create( existing: FeeTier?, parser: ParserProtocol, data: Map<*, *>?, localizer: LocalizerProtocol?, ): FeeTier? - CyclomaticComplexMethod:ConnectionStats.kt$ConnectionStats$private fun apiState( apiState: ApiState?, indexerState: NetworkState, validatorState: NetworkState, ): ApiState - CyclomaticComplexMethod:FieldsInputValidator.kt$FieldsInputValidator$private fun errorStringKey( transaction: Map<String, Any>, transactionType: String, field: String ): String? - CyclomaticComplexMethod:JsonEncoder.kt$JsonEncoder$internal fun encode(element: Any?): String - CyclomaticComplexMethod:Market.kt$MarketCandle.Companion$internal fun create( existing: MarketCandle?, parser: ParserProtocol, data: Map<*, *>?, ): MarketCandle? - CyclomaticComplexMethod:Market.kt$MarketConfigs.Companion$internal fun create( existing: MarketConfigs?, parser: ParserProtocol, data: Map<String, Any>, ): MarketConfigs? - CyclomaticComplexMethod:Market.kt$MarketTrade.Companion$internal fun create( existing: MarketTrade?, parser: ParserProtocol, data: Map<*, *>?, localizer: LocalizerProtocol?, ): MarketTrade? - CyclomaticComplexMethod:Market.kt$PerpetualMarket.Companion$internal fun create( existing: PerpetualMarket?, parser: ParserProtocol, data: Map<String, Any>, assets: Map<String, Any>?, resetOrderbook: Boolean, resetTrades: Boolean, ): PerpetualMarket? - CyclomaticComplexMethod:MarketsSupervisor.kt$MarketsSupervisor$internal fun receiveMarketsChannelSocketData( info: SocketInfo, payload: IMap<String, Any>, subaccountNumber: Int?, ) - CyclomaticComplexMethod:NetworkHelper.kt$NetworkHelper$internal fun updateStateChanges( stateMachine: TradingStateMachine, changes: StateChanges?, oldState: PerpetualState?, ) - CyclomaticComplexMethod:NotificationsProvider.kt$NotificationsProvider$private fun createOrderStatusNotification( stateMachine: TradingStateMachine, order: SubaccountOrder, ): Notification? - CyclomaticComplexMethod:OnboardingSupervisor.kt$OnboardingSupervisor$private fun cctpToNoble( state: PerpetualState?, decimals: Int, gas: BigDecimal, accountAddress: String, subaccountNumber: Int?, callback: TransactionCallback ) - CyclomaticComplexMethod:OnboardingSupervisor.kt$OnboardingSupervisor$private fun didUpdateStateForTransfer( data: String?, type: TransferInputField?, accountAddress: String, sourceAddress: String, subaccountNumber: Int? ) - CyclomaticComplexMethod:OnboardingSupervisor.kt$OnboardingSupervisor$private fun retrieveDepositRouteV1( state: PerpetualState?, accountAddress: String, sourceAddress: String, subaccountNumber: Int?, ) - CyclomaticComplexMethod:OnboardingSupervisor.kt$OnboardingSupervisor$private fun retrieveDepositRouteV2( state: PerpetualState?, accountAddress: String, sourceAddress: String, subaccountNumber: Int?, ) - CyclomaticComplexMethod:OnboardingSupervisor.kt$OnboardingSupervisor$private fun retrieveWithdrawalRouteNoble( state: PerpetualState?, decimals: Int, gas: BigDecimal, accountAddress: String, sourceAddress: String, subaccountNumber: Int?, ) - CyclomaticComplexMethod:OnboardingSupervisor.kt$OnboardingSupervisor$private fun retrieveWithdrawalRouteV1( state: PerpetualState?, decimals: Int, gas: BigDecimal, accountAddress: String, sourceAddress: String, subaccountNumber: Int?, ) - CyclomaticComplexMethod:OnboardingSupervisor.kt$OnboardingSupervisor$private fun retrieveWithdrawalRouteV2( state: PerpetualState?, decimals: Int, gas: BigDecimal, accountAddress: String, sourceAddress: String, subaccountNumber: Int?, ) - CyclomaticComplexMethod:OrderProcessor.kt$OrderProcessor$private fun shouldUpdate(existing: Map<String, Any>?, payload: Map<String, Any>): Boolean - CyclomaticComplexMethod:OrderbookProcessor.kt$OrderbookProcessor$fun consolidate(orderbook: Map<String, Any>?, stepSize: Double): Map<String, Any>? - CyclomaticComplexMethod:OrderbookProcessor.kt$OrderbookProcessor$private fun receivedChangesLinear( existing: List<Map<String, Any>>?, changes: List<Any>, offset: Long?, ascending: Boolean ): List<Map<String, Any>> - CyclomaticComplexMethod:Parser.kt$Parser$override fun asBool(data: Any?): Boolean? - CyclomaticComplexMethod:ParsingHelper.kt$ParsingHelper.Companion$internal fun <T : Any> merge( parser: ParserProtocol, existing: List<T>?, data: List<*>?, comparison: ObjectAndDataComparisonBlock, createObject: ObjectCreationBlock, syncItems: Boolean = false, includesObjectBlock: IncludesObjectBlock? = null, includesDataBlock: IncludesDataBlock? = null, ): List<T>? - CyclomaticComplexMethod:ParsingHelper.kt$ParsingHelper.Companion$internal inline fun <reified T : Any> transform( parser: ParserProtocol, existing: List<T>?, data: Map<*, *>?, key: ObjectKeyBlock, changed: ObjectAndDataChangedBlock, crossinline comparison: ObjectComparisonBlock, createObject: ObjectCreationBlock, ): List<T>? - CyclomaticComplexMethod:StateManagerAdaptor.kt$StateManagerAdaptor$@Throws(Exception::class) fun placeOrderPayload(): HumanReadablePlaceOrderPayload - CyclomaticComplexMethod:StateManagerAdaptor.kt$StateManagerAdaptor$@Throws(Exception::class) private fun socket( payload: IMap<String, Any>, ) - CyclomaticComplexMethod:StateManagerAdaptor.kt$StateManagerAdaptor$private fun updateStateChanges( state: PerpetualState?, changes: StateChanges?, oldState: PerpetualState?, ) - CyclomaticComplexMethod:SubaccountCalculator.kt$SubaccountCalculator$private fun calculatePositionValues( position: Map<String, Any>, market: Map<String, Any>?, subaccount: Map<String, Any>, price: Double?, periods: Set<CalculationPeriod>, ): MutableMap<String, Any> - CyclomaticComplexMethod:SubaccountSupervisor.kt$SubaccountSupervisor$@Throws(Exception::class) fun placeOrderPayload(currentHeight: Int?): HumanReadablePlaceOrderPayload - CyclomaticComplexMethod:SubaccountTransformer.kt$SubaccountTransformer$private fun deltaFromTrade( parser: ParserProtocol, trade: Map<String, Any>, market: Map<String, Any>?, usePessimisticCollateralCheck: Boolean, useOptimisticCollateralCheck: Boolean, ): Map<String, Any>? - CyclomaticComplexMethod:TradeAccountStateValidator.kt$TradeAccountStateValidator$private fun fillsExistingOrder( parser: ParserProtocol, trade: Map<String, Any>, orders: Map<String, Any>?, ): Boolean - CyclomaticComplexMethod:TradeInput.kt$TradeInput.Companion$internal fun create( existing: TradeInput?, parser: ParserProtocol, data: Map<*, *>?, ): TradeInput? - CyclomaticComplexMethod:TradeInput.kt$TradeInputOptions.Companion$internal fun create( existing: TradeInputOptions?, parser: ParserProtocol, data: Map<*, *>?, ): TradeInputOptions? - CyclomaticComplexMethod:TradeInputCalculator.kt$TradeInputCalculator$private fun calculatedOptionsFromFields( fields: List<Any>?, trade: Map<String, Any>, position: Map<String, Any>?, market: Map<String, Any>?, ): Map<String, Any>? - CyclomaticComplexMethod:TradeInputCalculator.kt$TradeInputCalculator$private fun summaryForType( trade: Map<String, Any>, subaccount: Map<String, Any>?, user: Map<String, Any>?, market: Map<String, Any>?, rewardsParams: Map<String, Any>?, feeTiers: List<Any>?, type: String, ): Map<String, Any> - CyclomaticComplexMethod:TradeInputValidator.kt$TradeInputValidator$private fun change( parser: ParserProtocol, subaccount: Map<String, Any>?, trade: Map<String, Any>, ): PositionChange - CyclomaticComplexMethod:TradeTriggerPriceValidator.kt$TradeTriggerPriceValidator$override fun validateTrade( subaccount: Map<String, Any>?, market: Map<String, Any>?, configs: Map<String, Any>?, trade: Map<String, Any>, change: PositionChange, restricted: Boolean, environment: V4Environment?, ): List<Any>? - CyclomaticComplexMethod:TradingStateMachine+ClosePositionInput.kt$fun TradingStateMachine.closePosition( data: String?, type: ClosePositionInputField, subaccountNumber: Int ): StateResponse - CyclomaticComplexMethod:TradingStateMachine+TradeInput.kt$fun TradingStateMachine.trade( data: String?, type: TradeInputField?, subaccountNumber: Int, ): StateResponse - CyclomaticComplexMethod:TradingStateMachine+TradeInput.kt$fun TradingStateMachine.tradeDataOption(typeText: String?): String? - CyclomaticComplexMethod:TradingStateMachine+TransferInput.kt$fun TradingStateMachine.transfer( data: String?, type: TransferInputField?, subaccountNumber: Int = 0 ): StateResponse - CyclomaticComplexMethod:TradingStateMachine+TriggerOrdersInput.kt$fun TradingStateMachine.triggerOrders( data: String?, type: TriggerOrdersInputField?, subaccountNumber: Int, ): StateResponse - CyclomaticComplexMethod:TradingStateMachine.kt$TradingStateMachine$@Throws(Exception::class) private fun socket( url: AbUrl, payload: Map<String, Any>, subaccountNumber: Int, height: BlockAndTime?, ): StateResponse - CyclomaticComplexMethod:TradingStateMachine.kt$TradingStateMachine$fun rest( url: AbUrl, payload: String, subaccountNumber: Int, height: Int?, deploymentUri: String? = null, period: String? = null, ): StateResponse - CyclomaticComplexMethod:TradingStateMachine.kt$TradingStateMachine$internal fun update(changes: StateChanges): StateChanges - CyclomaticComplexMethod:TradingStateMachine.kt$TradingStateMachine$private fun recalculateStates(changes: StateChanges) - CyclomaticComplexMethod:TradingStateMachine.kt$TradingStateMachine$private fun update( state: PerpetualState?, changes: StateChanges, tokensInfo: Map<String, TokenInfo>, localizer: LocalizerProtocol?, ): PerpetualState - CyclomaticComplexMethod:TransferInput.kt$DepositInputOptions.Companion$internal fun create( existing: DepositInputOptions?, parser: ParserProtocol, data: Map<*, *>? ): DepositInputOptions? - CyclomaticComplexMethod:TransferInput.kt$TransferInput.Companion$internal fun create( existing: TransferInput?, parser: ParserProtocol, data: Map<*, *>?, environment: V4Environment? ): TransferInput? - CyclomaticComplexMethod:TransferInput.kt$TransferInputRequestPayload.Companion$internal fun create( existing: TransferInputRequestPayload?, parser: ParserProtocol, data: Map<*, *>? ): TransferInputRequestPayload? - CyclomaticComplexMethod:TransferInput.kt$TransferInputSummary.Companion$internal fun create( existing: TransferInputSummary?, parser: ParserProtocol, data: Map<*, *>? ): TransferInputSummary? - CyclomaticComplexMethod:TransferInput.kt$WithdrawalInputOptions.Companion$internal fun create( existing: WithdrawalInputOptions?, parser: ParserProtocol, data: Map<*, *>? ): WithdrawalInputOptions? - CyclomaticComplexMethod:TriggerOrdersInputCalculator.kt$TriggerOrdersInputCalculator$private fun calculateTriggerPrices( triggerPrices: Map<String, Any>, position: Map<String, Any>, size: Double?, ): MutableMap<String, Any> - CyclomaticComplexMethod:TriggerOrdersInputValidator.kt$TriggerOrdersInputValidator$private fun validateCalculatedPricesPositive( triggerOrder: Map<String, Any>, ): List<Any>? - CyclomaticComplexMethod:TriggerOrdersInputValidator.kt$TriggerOrdersInputValidator$private fun validateLimitPrice( triggerOrder: Map<String, Any>, ): List<Any>? - CyclomaticComplexMethod:V4StateManagerAdaptor+Transfer.kt$internal fun V4StateManagerAdaptor.cctpToNoble( state: PerpetualState?, decimals: Int, gas: BigDecimal, callback: TransactionCallback ) - CyclomaticComplexMethod:V4StateManagerAdaptor+Transfer.kt$internal fun V4StateManagerAdaptor.retrieveWithdrawalRouteNoble( state: PerpetualState?, decimals: Int, gas: BigDecimal, ) - CyclomaticComplexMethod:V4StateManagerAdaptor+Transfer.kt$internal fun V4StateManagerAdaptor.retrieveWithdrawalRouteV1( state: PerpetualState?, decimals: Int, gas: BigDecimal, ) - CyclomaticComplexMethod:V4StateManagerAdaptor+Transfer.kt$internal fun V4StateManagerAdaptor.retrieveWithdrawalRouteV2( state: PerpetualState?, decimals: Int, gas: BigDecimal, ) - CyclomaticComplexMethod:V4StateManagerAdaptor+Transfer.kt$private fun V4StateManagerAdaptor.retrieveDepositRouteV1(state: PerpetualState?) - CyclomaticComplexMethod:V4StateManagerAdaptor+Transfer.kt$private fun V4StateManagerAdaptor.retrieveDepositRouteV2(state: PerpetualState?) - CyclomaticComplexMethod:V4StateManagerAdaptor.kt$V4StateManagerAdaptor$override fun didUpdateStateForTransfer(data: String?, type: TransferInputField?) - CyclomaticComplexMethod:V4StateManagerAdaptor.kt$V4StateManagerAdaptor$private fun apiState( apiState: ApiState?, indexerState: NetworkState, validatorState: NetworkState, ): ApiState - CyclomaticComplexMethod:Wallet.kt$User.Companion$internal fun create( existing: User?, parser: ParserProtocol, data: Map<*, *>? ): User? EmptyDefaultConstructor:AccountTransformer.kt$AccountTransformer$() EmptyDefaultConstructor:Network.kt$NetworkState$() EmptyDefaultConstructor:Timer.kt$LocalTimer$() @@ -352,102 +181,27 @@ FunctionOnlyReturningConstant:V4StateManagerConfigs.kt$V4StateManagerConfigs$fun nobleDenom(): String? FunctionParameterNaming:AsyncAbacusStateManager.kt$AsyncAbacusStateManager.Companion$_nativeImplementations: ProtocolNativeImpFactory FunctionParameterNaming:AsyncAbacusStateManagerV2.kt$AsyncAbacusStateManagerV2.Companion$_nativeImplementations: ProtocolNativeImpFactory - LargeClass:AccountSupervisor.kt$AccountSupervisor : DynamicNetworkSupervisor LargeClass:OnboardingSupervisor.kt$OnboardingSupervisor : NetworkSupervisor LargeClass:StateManagerAdaptor.kt$StateManagerAdaptor LargeClass:SubaccountSupervisor.kt$SubaccountSupervisor : DynamicNetworkSupervisor LargeClass:TradeInputCalculator.kt$TradeInputCalculator LargeClass:TradingStateMachine.kt$TradingStateMachine LargeClass:V4StateManagerAdaptor.kt$V4StateManagerAdaptor : StateManagerAdaptor - LongMethod:Account.kt$Account.Companion$internal fun create( existing: Account?, parser: ParserProtocol, data: Map<String, Any>, tokensInfo: Map<String, TokenInfo>, localizer: LocalizerProtocol?, ): Account LongMethod:Account.kt$Subaccount.Companion$internal fun create( existing: Subaccount?, parser: ParserProtocol, data: Map<*, *>?, localizer: LocalizerProtocol?, ): Subaccount? LongMethod:Account.kt$SubaccountOrder.Companion$internal fun create( existing: SubaccountOrder?, parser: ParserProtocol, data: Map<*, *>?, localizer: LocalizerProtocol?, ): SubaccountOrder? LongMethod:Account.kt$SubaccountPosition.Companion$internal fun create( existing: SubaccountPosition?, parser: ParserProtocol, data: Map<String, Any>?, ): SubaccountPosition? - LongMethod:Account.kt$TradingRewards.Companion$private fun createHistoricalTradingRewardsPerPeriod( objs: IList<HistoricalTradingReward>?, data: List<Any>?, parser: ParserProtocol, period: String, ): IList<HistoricalTradingReward> - LongMethod:AccountCalculator.kt$AccountCalculator$private fun mergeChildPendingPositions( parentSubaccount: Map<String, Any>, childSubaccountNumber: Int, childSubaccount: Map<String, Any>, childOrders: Map<String, Any>, markets: Map<String, Any>?, ): Map<String, Any> - LongMethod:ConnectionStats.kt$ConnectionStats$private fun apiState( apiState: ApiState?, indexerState: NetworkState, validatorState: NetworkState, ): ApiState - LongMethod:JsonEncoder.kt$JsonEncoder$internal fun encode(element: Any?): String - LongMethod:Market.kt$MarketConfigs.Companion$internal fun create( existing: MarketConfigs?, parser: ParserProtocol, data: Map<String, Any>, ): MarketConfigs? LongMethod:NetworkHelper.kt$NetworkHelper$internal fun updateStateChanges( stateMachine: TradingStateMachine, changes: StateChanges?, oldState: PerpetualState?, ) - LongMethod:NotificationsProvider.kt$NotificationsProvider$private fun createNotificationForFill( stateMachine: TradingStateMachine, fill: SubaccountFill, ): Notification? - LongMethod:NotificationsProvider.kt$NotificationsProvider$private fun createOrderStatusNotification( stateMachine: TradingStateMachine, order: SubaccountOrder, ): Notification? - LongMethod:OnboardingSupervisor.kt$OnboardingSupervisor$private fun cctpToNoble( state: PerpetualState?, decimals: Int, gas: BigDecimal, accountAddress: String, subaccountNumber: Int?, callback: TransactionCallback ) - LongMethod:OnboardingSupervisor.kt$OnboardingSupervisor$private fun didUpdateStateForTransfer( data: String?, type: TransferInputField?, accountAddress: String, sourceAddress: String, subaccountNumber: Int? ) - LongMethod:OnboardingSupervisor.kt$OnboardingSupervisor$private fun retrieveDepositRouteV2( state: PerpetualState?, accountAddress: String, sourceAddress: String, subaccountNumber: Int?, ) - LongMethod:OnboardingSupervisor.kt$OnboardingSupervisor$private fun retrieveWithdrawalRouteV2( state: PerpetualState?, decimals: Int, gas: BigDecimal, accountAddress: String, sourceAddress: String, subaccountNumber: Int?, ) - LongMethod:OrderbookProcessor.kt$OrderbookProcessor$private fun receivedChangesLinear( existing: List<Map<String, Any>>?, changes: List<Any>, offset: Long?, ascending: Boolean ): List<Map<String, Any>> - LongMethod:ParsingHelper.kt$ParsingHelper.Companion$internal fun <T : Any> merge( parser: ParserProtocol, existing: List<T>?, data: List<*>?, comparison: ObjectAndDataComparisonBlock, createObject: ObjectCreationBlock, syncItems: Boolean = false, includesObjectBlock: IncludesObjectBlock? = null, includesDataBlock: IncludesDataBlock? = null, ): List<T>? - LongMethod:StateManagerAdaptor.kt$StateManagerAdaptor$@Throws(Exception::class) fun placeOrderPayload(): HumanReadablePlaceOrderPayload LongMethod:StateManagerAdaptor.kt$StateManagerAdaptor$private fun updateStateChanges( state: PerpetualState?, changes: StateChanges?, oldState: PerpetualState?, ) LongMethod:SubaccountCalculator.kt$SubaccountCalculator$private fun calculatePositionValues( position: Map<String, Any>, market: Map<String, Any>?, subaccount: Map<String, Any>, price: Double?, periods: Set<CalculationPeriod>, ): MutableMap<String, Any> - LongMethod:SubaccountCalculator.kt$SubaccountCalculator$private fun calculateSubaccountEquity( subaccount: MutableMap<String, Any>, positions: Map<String, Map<String, Any>>?, periods: Set<CalculationPeriod>, ) - LongMethod:SubaccountSupervisor.kt$SubaccountSupervisor$@Throws(Exception::class) fun placeOrderPayload(currentHeight: Int?): HumanReadablePlaceOrderPayload - LongMethod:SubaccountSupervisor.kt$SubaccountSupervisor$private fun submitPlaceOrder( callback: TransactionCallback, payload: HumanReadablePlaceOrderPayload, analyticsPayload: IMap<String, Any>?, isTriggerOrder: Boolean = false, transferPayload: HumanReadableSubaccountTransferPayload? = null, ): HumanReadablePlaceOrderPayload - LongMethod:TradeAccountStateValidator.kt$TradeAccountStateValidator$private fun fillsExistingOrder( parser: ParserProtocol, trade: Map<String, Any>, orders: Map<String, Any>?, ): Boolean - LongMethod:TradeInput.kt$TradeInput.Companion$internal fun create( existing: TradeInput?, parser: ParserProtocol, data: Map<*, *>?, ): TradeInput? LongMethod:TradeInput.kt$TradeInputOptions.Companion$internal fun create( existing: TradeInputOptions?, parser: ParserProtocol, data: Map<*, *>?, ): TradeInputOptions? - LongMethod:TradeInputCalculator.kt$TradeInputCalculator$internal fun calculate( state: Map<String, Any>, subaccountNumber: Int?, input: String?, ): Map<String, Any> - LongMethod:TradeInputCalculator.kt$TradeInputCalculator$private fun calculateMarketOrderFromLeverage( equity: Double, oraclePrice: Double, positionSize: Double?, isBuying: Boolean, feeRate: Double, leverage: Double, stepSize: Double, orderbook: List<Map<String, Any>>, ): Map<String, Any>? - LongMethod:TradeInputCalculator.kt$TradeInputCalculator$private fun calculateMarketOrderFromUsdcSize( usdcSize: Double?, orderbook: List<Map<String, Any>>?, stepSize: Double, ): Map<String, Any>? - LongMethod:TradeInputCalculator.kt$TradeInputCalculator$private fun calculatedOptionsFromFields( fields: List<Any>?, trade: Map<String, Any>, position: Map<String, Any>?, market: Map<String, Any>?, ): Map<String, Any>? - LongMethod:TradeInputCalculator.kt$TradeInputCalculator$private fun requiredFields(trade: Map<String, Any>, market: Map<String, Any>?): List<Any>? LongMethod:TradeInputCalculator.kt$TradeInputCalculator$private fun summaryForType( trade: Map<String, Any>, subaccount: Map<String, Any>?, user: Map<String, Any>?, market: Map<String, Any>?, rewardsParams: Map<String, Any>?, feeTiers: List<Any>?, type: String, ): Map<String, Any> - LongMethod:TradeInputDataValidator.kt$TradeInputDataValidator$private fun validateOrder( trade: Map<String, Any>, subaccount: Map<String, Any>?, configs: Map<String, Any>?, environment: V4Environment?, ): List<Any>? - LongMethod:TradePositionStateValidator.kt$TradePositionStateValidator$private fun validatePositionLeverage( position: Map<String, Any>, trade: Map<String, Any>, change: PositionChange, restricted: Boolean, ): Map<String, Any>? - LongMethod:TradeTriggerPriceValidator.kt$TradeTriggerPriceValidator$override fun validateTrade( subaccount: Map<String, Any>?, market: Map<String, Any>?, configs: Map<String, Any>?, trade: Map<String, Any>, change: PositionChange, restricted: Boolean, environment: V4Environment?, ): List<Any>? - LongMethod:TradingStateMachine+ClosePositionInput.kt$fun TradingStateMachine.closePosition( data: String?, type: ClosePositionInputField, subaccountNumber: Int ): StateResponse LongMethod:TradingStateMachine+TradeInput.kt$fun TradingStateMachine.trade( data: String?, type: TradeInputField?, subaccountNumber: Int, ): StateResponse LongMethod:TradingStateMachine+TransferInput.kt$fun TradingStateMachine.transfer( data: String?, type: TransferInputField?, subaccountNumber: Int = 0 ): StateResponse LongMethod:TradingStateMachine+TriggerOrdersInput.kt$fun TradingStateMachine.triggerOrders( data: String?, type: TriggerOrdersInputField?, subaccountNumber: Int, ): StateResponse LongMethod:TradingStateMachine.kt$TradingStateMachine$@Throws(Exception::class) private fun socket( url: AbUrl, payload: Map<String, Any>, subaccountNumber: Int, height: BlockAndTime?, ): StateResponse - LongMethod:TradingStateMachine.kt$TradingStateMachine$internal fun update(changes: StateChanges): StateChanges - LongMethod:TradingStateMachine.kt$TradingStateMachine$private fun calculateReceipt(input: Map<String, Any>): List<String>? - LongMethod:TradingStateMachine.kt$TradingStateMachine$private fun recalculateStates(changes: StateChanges) LongMethod:TradingStateMachine.kt$TradingStateMachine$private fun update( state: PerpetualState?, changes: StateChanges, tokensInfo: Map<String, TokenInfo>, localizer: LocalizerProtocol?, ): PerpetualState - LongMethod:TransferInput.kt$DepositInputOptions.Companion$internal fun create( existing: DepositInputOptions?, parser: ParserProtocol, data: Map<*, *>? ): DepositInputOptions? LongMethod:TransferInput.kt$TransferInput.Companion$internal fun create( existing: TransferInput?, parser: ParserProtocol, data: Map<*, *>?, environment: V4Environment? ): TransferInput? - LongMethod:TransferInput.kt$WithdrawalInputOptions.Companion$internal fun create( existing: WithdrawalInputOptions?, parser: ParserProtocol, data: Map<*, *>? ): WithdrawalInputOptions? - LongMethod:TransferInputCalculator.kt$TransferInputCalculator$private fun summaryForType( transfer: Map<String, Any>, type: String ): Map<String, Any> LongMethod:TriggerOrdersInputCalculator.kt$TriggerOrdersInputCalculator$private fun calculateTriggerPrices( triggerPrices: Map<String, Any>, position: Map<String, Any>, size: Double?, ): MutableMap<String, Any> - LongMethod:TriggerOrdersInputValidator.kt$TriggerOrdersInputValidator$private fun validateOrderCount( triggerOrders: Map<String, Any>, subaccount: Map<String, Any>?, configs: Map<String, Any>?, environment: V4Environment?, ): List<Any>? - LongMethod:V4StateManagerAdaptor+Transfer.kt$internal fun V4StateManagerAdaptor.cctpToNoble( state: PerpetualState?, decimals: Int, gas: BigDecimal, callback: TransactionCallback ) - LongMethod:V4StateManagerAdaptor+Transfer.kt$internal fun V4StateManagerAdaptor.retrieveWithdrawalRouteV2( state: PerpetualState?, decimals: Int, gas: BigDecimal, ) - LongMethod:V4StateManagerAdaptor+Transfer.kt$private fun V4StateManagerAdaptor.retrieveDepositRouteV2(state: PerpetualState?) - LongMethod:V4StateManagerAdaptor.kt$V4StateManagerAdaptor$override fun didUpdateStateForTransfer(data: String?, type: TransferInputField?) - LongMethod:V4StateManagerAdaptor.kt$V4StateManagerAdaptor$private fun apiState( apiState: ApiState?, indexerState: NetworkState, validatorState: NetworkState, ): ApiState - LongParameterList:AccountCalculator.kt$AccountCalculator$( account: Map<String, Any>?, subaccountNumbers: List<Int>, configs: Map<String, Any>?, markets: Map<String, Any>?, price: Map<String, Any>?, periods: Set<CalculationPeriod>, ) - LongParameterList:AccountTransformer.kt$AccountTransformer$( account: Map<String, Any>?, subaccountNumber: Int?, trade: Map<String, Any>, market: Map<String, Any>?, parser: ParserProtocol, period: String, usePessimisticCollateralCheck: Boolean, useOptimisticCollateralCheck: Boolean ) - LongParameterList:AsyncAbacusStateManager.kt$AsyncAbacusStateManager$( val deploymentUri: String, val deployment: String, // MAINNET, TESTNET, DEV val appConfigs: AppConfigs, val ioImplementations: IOImplementations, val uiImplementations: UIImplementations, val stateNotification: StateNotificationProtocol? = null, val dataNotification: DataNotificationProtocol? = null ) - LongParameterList:AsyncAbacusStateManagerV2.kt$AsyncAbacusStateManagerV2$( val deploymentUri: String, val deployment: String, // MAINNET, TESTNET, DEV val appConfigs: AppConfigsV2, val ioImplementations: IOImplementations, val uiImplementations: UIImplementations, val stateNotification: StateNotificationProtocol? = null, val dataNotification: DataNotificationProtocol? = null ) - LongParameterList:BaseInputValidator.kt$BaseInputValidator$( type: String, errorCode: String, fields: List<String>?, actionStringKey: String?, titleStringKey: String, textStringKey: String, textParams: Map<String, Any>? = null, action: String? = null, link: String? = null, linkText: String? = null, ) - LongParameterList:Enviroment.kt$Environment$( val id: String, val name: String?, val ethereumChainId: String, val dydxChainId: String?, val squidIntegratorId: String?, val isMainNet: Boolean, val endpoints: EnvironmentEndpoints, val links: EnvironmentLinks?, val walletConnection: WalletConnection?, val apps: AppsRequirements?, val governance: EnvironmentGovernance?, val featureFlags: EnvironmentFeatureFlags, ) - LongParameterList:Enviroment.kt$V4Environment$( id: String, name: String?, ethereumChainId: String, dydxChainId: String?, squidIntegratorId: String?, val chainName: String?, val chainLogo: String?, isMainNet: Boolean, endpoints: EnvironmentEndpoints, links: EnvironmentLinks?, walletConnection: WalletConnection?, apps: AppsRequirements?, val tokens: IMap<String, TokenInfo>, governance: EnvironmentGovernance?, featureFlags: EnvironmentFeatureFlags, ) - LongParameterList:Enviroment.kt$V4Environment.Companion$( id: String, data: Map<String, Any>, parser: ParserProtocol, deploymentUri: String, localizer: LocalizerProtocol?, tokensData: Map<String, Any>?, linksData: Map<String, Any>?, walletsData: Map<String, Any>?, governanceData: Map<String, Any>?, ) - LongParameterList:InputValidator.kt$InputValidator$( wallet: Map<String, Any>?, user: Map<String, Any>?, subaccount: Map<String, Any>?, markets: Map<String, Any>?, configs: Map<String, Any>?, currentBlockAndHeight: BlockAndTime?, transaction: Map<String, Any>, transactionType: String, environment: V4Environment?, ) - LongParameterList:InputValidator.kt$InputValidator$( wallet: Map<String, Any>?, user: Map<String, Any>?, subaccount: Map<String, Any>?, markets: Map<String, Any>?, input: Map<String, Any>?, configs: Map<String, Any>?, currentBlockAndHeight: BlockAndTime?, environment: V4Environment?, ) - LongParameterList:Market.kt$PerpetualMarket.Companion$( existing: PerpetualMarket?, parser: ParserProtocol, data: Map<String, Any>, assets: Map<String, Any>?, resetOrderbook: Boolean, resetTrades: Boolean, ) - LongParameterList:NetworkHelper.kt$NetworkHelper$( internal val deploymentUri: String, internal val environment: V4Environment, internal val uiImplementations: UIImplementations, internal val ioImplementations: IOImplementations, internal val configs: V4StateManagerConfigs, internal var stateNotification: StateNotificationProtocol?, internal var dataNotification: DataNotificationProtocol?, internal val parser: ParserProtocol, internal val indexerRestrictionChanged: (UsageRestriction?) -> Unit ) - LongParameterList:NetworkHelper.kt$NetworkHelper$( url: String, items: List<Any>?, timeField: String, sampleDuration: Duration, maxDuration: Duration, beforeParam: String, afterParam: String? = null, additionalParams: Map<String, String>? = null, previousUrl: String?, callback: RestCallbackWithUrl, ) - LongParameterList:OnboardingSupervisor.kt$OnboardingSupervisor$( state: PerpetualState?, decimals: Int, gas: BigDecimal, accountAddress: String, sourceAddress: String, subaccountNumber: Int?, ) - LongParameterList:OnboardingSupervisor.kt$OnboardingSupervisor$( state: PerpetualState?, decimals: Int, gas: BigDecimal, accountAddress: String, subaccountNumber: Int?, callback: TransactionCallback ) - LongParameterList:ParsingHelper.kt$ParsingHelper.Companion$( parser: ParserProtocol, existing: List<T>?, data: List<*>?, comparison: ObjectAndDataComparisonBlock, createObject: ObjectCreationBlock, syncItems: Boolean = false, includesObjectBlock: IncludesObjectBlock? = null, includesDataBlock: IncludesDataBlock? = null, ) - LongParameterList:ParsingHelper.kt$ParsingHelper.Companion$( parser: ParserProtocol, existing: List<T>?, data: Map<*, *>?, key: ObjectKeyBlock, changed: ObjectAndDataChangedBlock, crossinline comparison: ObjectComparisonBlock, createObject: ObjectCreationBlock, ) - LongParameterList:ProtocolNativeImpFactory.kt$IOImplementations$( var rest: RestProtocol?, var webSocket: WebSocketProtocol?, var chain: DYDXChainTransactionsProtocol?, var tracking: TrackingProtocol?, var threading: ThreadingProtocol?, var timer: TimerProtocol?, var fileSystem: FileSystemProtocol?, ) - LongParameterList:ProtocolNativeImpFactory.kt$ProtocolNativeImpFactory$( var rest: RestProtocol? = null, var webSocket: WebSocketProtocol? = null, var chain: DYDXChainTransactionsProtocol? = null, var localizer: LocalizerProtocol? = null, var formatter: FormatterProtocol? = null, var tracking: TrackingProtocol? = null, var threading: ThreadingProtocol? = null, var timer: TimerProtocol? = null, var stateNotification: StateNotificationProtocol? = null, var dataNotification: DataNotificationProtocol? = null, var fileSystem: FileSystemProtocol? = null, var v3Signer: V3PrivateSignerProtocol? = null, var apiKey: V3ApiKey? = null, ) - LongParameterList:StateManagerAdaptor.kt$StateManagerAdaptor$( url: String, items: List<Any>?, timeField: String, sampleDuration: Duration, maxDuration: Duration, beforeParam: String, afterParam: String? = null, additionalParams: Map<String, String>? = null, previousUrl: String?, callback: (url: String, response: String?, httpCode: Int, headers: Map<String, Any>?) -> Unit, ) - LongParameterList:StateManagerAdaptor.kt$StateManagerAdaptor$( val deploymentUri: String, val environment: V4Environment, val ioImplementations: IOImplementations, val uiImplementations: UIImplementations, open val configs: StateManagerConfigs, val appConfigs: AppConfigs, var stateNotification: StateNotificationProtocol?, var dataNotification: DataNotificationProtocol?, ) - LongParameterList:StateManagerAdaptorV2.kt$StateManagerAdaptorV2$( val deploymentUri: String, val environment: V4Environment, val ioImplementations: IOImplementations, val uiImplementations: UIImplementations, val configs: V4StateManagerConfigs, val appConfigs: AppConfigsV2, var stateNotification: StateNotificationProtocol?, var dataNotification: DataNotificationProtocol?, ) - LongParameterList:SubaccountTransformer.kt$SubaccountTransformer$( subaccount: Map<String, Any>?, trade: Map<String, Any>, market: Map<String, Any>?, parser: ParserProtocol, period: String, usePessimisticCollateralCheck: Boolean, useOptimisticCollateralCheck: Boolean, ) - LongParameterList:TradeInputCalculator.kt$TradeInputCalculator$( equity: Double, oraclePrice: Double, positionSize: Double?, isBuying: Boolean, feeRate: Double, leverage: Double, stepSize: Double, orderbook: List<Map<String, Any>>, ) - LongParameterList:TradeInputCalculator.kt$TradeInputCalculator$( trade: Map<String, Any>, market: Map<String, Any>?, subaccount: Map<String, Any>?, user: Map<String, Any>, isBuying: Boolean, input: String, ) - LongParameterList:TradeInputCalculator.kt$TradeInputCalculator$( trade: Map<String, Any>, subaccount: Map<String, Any>?, user: Map<String, Any>?, market: Map<String, Any>?, rewardsParams: Map<String, Any>?, feeTiers: List<Any>?, type: String, ) - LongParameterList:TradeInputValidator.kt$TradeInputValidator$( parser: ParserProtocol, subaccount: Map<String, Any>?, market: Map<String, Any>?, trade: Map<String, Any>, change: PositionChange, restricted: Boolean, ) - LongParameterList:TradingStateMachine.kt$TradingStateMachine$( url: AbUrl, payload: String, subaccountNumber: Int, height: Int?, deploymentUri: String? = null, period: String? = null, ) - LongParameterList:TransferStatus.kt$TransferStatus$( val status: String?, val gasStatus: String?, val axelarTransactionUrl: String?, val fromChainStatus: TransferChainStatus?, val toChainStatus: TransferChainStatus?, var routeStatuses: IList<TransferRouteStatus>?, val error: String?, val squidTransactionStatus: String?, ) - LongParameterList:V4StateManagerAdaptor.kt$V4StateManagerAdaptor$( deploymentUri: String, environment: V4Environment, ioImplementations: IOImplementations, uiImplementations: UIImplementations, override var configs: V4StateManagerConfigs, appConfigs: AppConfigs, stateNotification: StateNotificationProtocol?, dataNotification: DataNotificationProtocol?, ) - LongParameterList:ValidatorProtocols.kt$TradeValidatorProtocol$( subaccount: Map<String, Any>?, market: Map<String, Any>?, configs: Map<String, Any>?, trade: Map<String, Any>, change: PositionChange, restricted: Boolean, environment: V4Environment?, ) - LongParameterList:ValidatorProtocols.kt$TransferValidatorProtocol$( wallet: Map<String, Any>?, subaccount: Map<String, Any>?, transfer: Map<String, Any>, configs: Map<String, Any>?, currentBlockAndHeight: BlockAndTime?, restricted: Boolean, environment: V4Environment?, ) - LongParameterList:ValidatorProtocols.kt$ValidatorProtocol$( wallet: Map<String, Any>?, user: Map<String, Any>?, subaccount: Map<String, Any>?, markets: Map<String, Any>?, configs: Map<String, Any>?, currentBlockAndHeight: BlockAndTime?, transaction: Map<String, Any>, transactionType: String, environment: V4Environment?, ) LoopWithTooManyJumpStatements:AccountCalculator.kt$AccountCalculator$for LoopWithTooManyJumpStatements:AsyncAbacusStateManager.kt$AsyncAbacusStateManager$for LoopWithTooManyJumpStatements:AsyncAbacusStateManagerV2.kt$AsyncAbacusStateManagerV2$for @@ -1020,49 +774,6 @@ TooGenericExceptionThrown:V4StateManagerAdaptor.kt$V4StateManagerAdaptor$throw Exception("candlesChannel is null") TooGenericExceptionThrown:V4StateManagerAdaptor.kt$V4StateManagerAdaptor$throw Exception("chain is not DYDXChainTransactionsProtocol") TooGenericExceptionThrown:V4StateManagerAdaptor.kt$V4StateManagerAdaptor$throw Exception("chain query is null") - TooManyFunctions:AccountProcessor.kt$SubaccountProcessor : BaseProcessor - TooManyFunctions:AccountProcessor.kt$V4AccountProcessor : BaseProcessor - TooManyFunctions:AccountSupervisor.kt$AccountSupervisor : DynamicNetworkSupervisor - TooManyFunctions:AccountSupervisor.kt$exchange.dydx.abacus.state.v2.supervisor.AccountSupervisor.kt - TooManyFunctions:AccountsSupervisor.kt$exchange.dydx.abacus.state.v2.supervisor.AccountsSupervisor.kt - TooManyFunctions:AsyncAbacusStateManager.kt$AsyncAbacusStateManager : SingletonAsyncAbacusStateManagerProtocol - TooManyFunctions:AsyncAbacusStateManagerProtocol.kt$AsyncAbacusStateManagerProtocol - TooManyFunctions:AsyncAbacusStateManagerV2.kt$AsyncAbacusStateManagerV2 : SingletonAsyncAbacusStateManagerProtocol - TooManyFunctions:BaseProcessor.kt$BaseProcessor - TooManyFunctions:ConnectionsSupervisor.kt$ConnectionsSupervisor : NetworkSupervisorConnectionStatsDelegate - TooManyFunctions:DynamicLocalizer.kt$DynamicLocalizer : AbacusLocalizerProtocol - TooManyFunctions:Map+Utils.kt$exchange.dydx.abacus.utils.Map+Utils.kt - TooManyFunctions:MarketProcessor.kt$MarketProcessor : BaseProcessor - TooManyFunctions:MarketSupervisor.kt$MarketSupervisor : DynamicNetworkSupervisor - TooManyFunctions:MarketsProcessor.kt$MarketsProcessor : BaseProcessor - TooManyFunctions:MarketsSummaryProcessor.kt$MarketsSummaryProcessor : BaseProcessor - TooManyFunctions:MarketsSupervisor.kt$MarketsSupervisor : NetworkSupervisor - TooManyFunctions:NetworkHelper.kt$NetworkHelper - TooManyFunctions:NetworkSupervisor.kt$NetworkSupervisor - TooManyFunctions:NotificationsProvider.kt$NotificationsProvider - TooManyFunctions:OnboardingSupervisor.kt$OnboardingSupervisor : NetworkSupervisor - TooManyFunctions:OrderbookProcessor.kt$OrderbookProcessor : BaseProcessor - TooManyFunctions:Parser.kt$Parser : ParserProtocol - TooManyFunctions:ParserProtocol.kt$ParserProtocol - TooManyFunctions:PerpetualState.kt$PerpetualState - TooManyFunctions:PublicProtocols.kt$DataNotificationProtocol - TooManyFunctions:SquidProcessor.kt$SquidProcessor : BaseProcessor - TooManyFunctions:StateManagerAdaptor.kt$StateManagerAdaptor - TooManyFunctions:StateManagerAdaptorV2.kt$StateManagerAdaptorV2 : ConnectionDelegate - TooManyFunctions:StateManagerConfigs.kt$StateManagerConfigs - TooManyFunctions:SubaccountCalculator.kt$SubaccountCalculator - TooManyFunctions:SubaccountSupervisor.kt$SubaccountSupervisor : DynamicNetworkSupervisor - TooManyFunctions:SubaccountTransformer.kt$SubaccountTransformer - TooManyFunctions:SystemSupervisor.kt$SystemSupervisor : NetworkSupervisor - TooManyFunctions:TradeBracketOrdersValidator.kt$TradeBracketOrdersValidator : BaseInputValidatorTradeValidatorProtocol - TooManyFunctions:TradeInputCalculator.kt$TradeInputCalculator - TooManyFunctions:TradingStateMachine+Wallet.kt$exchange.dydx.abacus.state.model.TradingStateMachine+Wallet.kt - TooManyFunctions:TradingStateMachine.kt$TradingStateMachine - TooManyFunctions:TriggerOrdersInputValidator.kt$TriggerOrdersInputValidator : BaseInputValidatorValidatorProtocol - TooManyFunctions:V4StateManagerAdaptor+Transfer.kt$exchange.dydx.abacus.state.manager.V4StateManagerAdaptor+Transfer.kt - TooManyFunctions:V4StateManagerAdaptor.kt$V4StateManagerAdaptor : StateManagerAdaptor - TooManyFunctions:V4StateManagerConfigs.kt$V4StateManagerConfigs : StateManagerConfigs - TooManyFunctions:WalletProcessor.kt$WalletProcessor : BaseProcessor UnusedParameter:AccountCalculator.kt$AccountCalculator$childSubaccountNumber: Int UnusedParameter:AccountInputValidator.kt$AccountInputValidator$parser: ParserProtocol UnusedParameter:AccountProcessor.kt$V4AccountDelegationsProcessor$existing: Map<String, Any>? diff --git a/detekt.yml b/detekt.yml index 5292364d2..71d42717d 100644 --- a/detekt.yml +++ b/detekt.yml @@ -3,4 +3,20 @@ naming: # some of our package folders are structured /exchange.dydx.abacus instead of: # /exchange -> /dydx -> /abacus # didn't seem worth the potential thrash in PRs to fix (feel free to fix if you feel differently) - active: false \ No newline at end of file + active: false + +complexity: + CognitiveComplexMethod: + active: false + ComplexCondition: + active: false + CyclomaticComplexMethod: + active: false + LongParameterList: + active: false + LargeClass: + threshold: 1000 # up from 600 + LongMethod: + threshold: 100 # up from 60 + TooManyFunctions: + active: false diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt index 58fdc3b0b..2cdca16d4 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/StateManagerAdaptor.kt @@ -76,7 +76,6 @@ import exchange.dydx.abacus.utils.IMap import exchange.dydx.abacus.utils.IMutableList import exchange.dydx.abacus.utils.IOImplementations import exchange.dydx.abacus.utils.JsonEncoder -import exchange.dydx.abacus.utils.Logger import exchange.dydx.abacus.utils.Parser import exchange.dydx.abacus.utils.ParsingHelper import exchange.dydx.abacus.utils.SHORT_TERM_ORDER_DURATION @@ -1883,8 +1882,11 @@ open class StateManagerAdaptor( val subaccountNumber = connectedSubaccountNumber ?: throw Exception("subaccountNumber is null") val subaccount = stateMachine.state?.subaccount(subaccountNumber) ?: throw Exception("subaccount is null") - val position = subaccount.openPositions?.find { it.id == marketId } - val positionSize = position?.size?.current + val position = subaccount.openPositions?.find { it.id == marketId } ?: throw ParsingException( + ParsingErrorType.MissingRequiredData, + "no open position for $marketId", + ) + val positionSize = position.size?.current fun updateTriggerOrder(triggerOrder: TriggerOrder) { // Cases @@ -2164,8 +2166,8 @@ open class StateManagerAdaptor( return HumanReadableCancelOrderPayload( subaccountNumber, - orderId, type, + orderId, clientId, orderFlags, clobPairId, @@ -2307,7 +2309,6 @@ open class StateManagerAdaptor( ioImplementations.threading?.async(ThreadingType.main) { ioImplementations.tracking?.log(eventName, paramsAsString) } - Logger.e { "xcxc $eventName $paramsAsString" } } private fun didSetPlaceOrderRecords() { @@ -2333,7 +2334,11 @@ open class StateManagerAdaptor( val interval = Clock.System.now().toEpochMilliseconds() .toDouble() - placeOrderRecord.timestampInMilliseconds tracking( - if (placeOrderRecord.isTriggerOrder) AnalyticsEvent.TriggerPlaceOrderConfirmed.rawValue else AnalyticsEvent.TradePlaceOrderConfirmed.rawValue, + if (placeOrderRecord.isTriggerOrder) { + AnalyticsEvent.TriggerPlaceOrderConfirmed.rawValue + } else { + AnalyticsEvent.TradePlaceOrderConfirmed.rawValue + }, ParsingHelper.merge( trackingParams(interval), orderAnalyticsPayload, @@ -2349,7 +2354,11 @@ open class StateManagerAdaptor( val interval = Clock.System.now().toEpochMilliseconds() .toDouble() - cancelOrderRecord.timestampInMilliseconds tracking( - if (cancelOrderRecord.isTriggerOrder) AnalyticsEvent.TriggerCancelOrderConfirmed.rawValue else AnalyticsEvent.TradeCancelOrderConfirmed.rawValue, + if (cancelOrderRecord.isTriggerOrder) { + AnalyticsEvent.TriggerCancelOrderConfirmed.rawValue + } else { + AnalyticsEvent.TradeCancelOrderConfirmed.rawValue + }, ParsingHelper.merge( trackingParams(interval), orderAnalyticsPayload, diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor.kt index 268e39b50..ce397d966 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/V4StateManagerAdaptor.kt @@ -12,6 +12,8 @@ import exchange.dydx.abacus.protocols.TransactionCallback import exchange.dydx.abacus.protocols.TransactionType import exchange.dydx.abacus.protocols.run import exchange.dydx.abacus.responses.ParsingError +import exchange.dydx.abacus.responses.ParsingErrorType +import exchange.dydx.abacus.responses.ParsingException import exchange.dydx.abacus.state.app.adaptors.V4TransactionErrors import exchange.dydx.abacus.state.manager.configs.V4StateManagerConfigs import exchange.dydx.abacus.state.model.TransferInputField @@ -1007,7 +1009,11 @@ class V4StateManagerAdaptor( val string = Json.encodeToString(payload) val marketId = payload.marketId val position = stateMachine.state?.subaccount(subaccountNumber)?.openPositions?.find { it.id == marketId } - val positionSize = position?.size?.current + ?: throw ParsingException( + ParsingErrorType.MissingRequiredData, + "no open position for $marketId", + ) + val positionSize = position.size?.current stopWatchingLastOrder() @@ -1062,7 +1068,7 @@ class V4StateManagerAdaptor( private fun submitCancelOrder( orderId: String, - marketId: String?, + marketId: String, callback: TransactionCallback, payload: HumanReadableCancelOrderPayload, analyticsPayload: IMap?, @@ -1073,7 +1079,11 @@ class V4StateManagerAdaptor( val string = Json.encodeToString(payload) val position = stateMachine.state?.subaccount(subaccountNumber)?.openPositions?.find { it.id == marketId } - val positionSize = position?.size?.current + ?: throw ParsingException( + ParsingErrorType.MissingRequiredData, + "no open position for $marketId", + ) + val positionSize = position.size?.current val isShortTermOrder = payload.orderFlags == 0 @@ -1149,9 +1159,17 @@ class V4StateManagerAdaptor( tracking( if (isCancel) { - if (isTriggerOrder) AnalyticsEvent.TriggerCancelOrder.rawValue else AnalyticsEvent.TradeCancelOrder.rawValue + if (isTriggerOrder) { + AnalyticsEvent.TriggerCancelOrder.rawValue + } else { + AnalyticsEvent.TradeCancelOrder.rawValue + } } else { - if (isTriggerOrder) AnalyticsEvent.TriggerPlaceOrder.rawValue else AnalyticsEvent.TradePlaceOrder.rawValue + if (isTriggerOrder) { + AnalyticsEvent.TriggerPlaceOrder.rawValue + } else { + AnalyticsEvent.TradePlaceOrder.rawValue + } }, ParsingHelper.merge(uiTrackingParams(uiDelayTimeMs), analyticsPayload) ?.toIMap(), @@ -1169,18 +1187,34 @@ class V4StateManagerAdaptor( if (error != null) { tracking( if (isCancel) { - if (isTriggerOrder) AnalyticsEvent.TriggerCancelOrderSubmissionFailed.rawValue else AnalyticsEvent.TradeCancelOrderSubmissionFailed.rawValue + if (isTriggerOrder) { + AnalyticsEvent.TriggerCancelOrderSubmissionFailed.rawValue + } else { + AnalyticsEvent.TradeCancelOrderSubmissionFailed.rawValue + } } else { - if (isTriggerOrder) AnalyticsEvent.TriggerPlaceOrderSubmissionFailed.rawValue else AnalyticsEvent.TradePlaceOrderSubmissionFailed.rawValue + if (isTriggerOrder) { + AnalyticsEvent.TriggerPlaceOrderSubmissionFailed.rawValue + } else { + AnalyticsEvent.TradePlaceOrderSubmissionFailed.rawValue + } }, ParsingHelper.merge(errorTrackingParams(error), analyticsPayload)?.toIMap(), ) } else { tracking( if (isCancel) { - if (isTriggerOrder) AnalyticsEvent.TriggerCancelOrderSubmissionConfirmed.rawValue else AnalyticsEvent.TradeCancelOrderSubmissionConfirmed.rawValue + if (isTriggerOrder) { + AnalyticsEvent.TriggerCancelOrderSubmissionConfirmed.rawValue + } else { + AnalyticsEvent.TradeCancelOrderSubmissionConfirmed.rawValue + } } else { - if (isTriggerOrder) AnalyticsEvent.TriggerPlaceOrderSubmissionConfirmed.rawValue else AnalyticsEvent.TradePlaceOrderSubmissionConfirmed.rawValue + if (isTriggerOrder) { + AnalyticsEvent.TriggerPlaceOrderSubmissionConfirmed.rawValue + } else { + AnalyticsEvent.TradePlaceOrderSubmissionConfirmed.rawValue + } }, analyticsPayload, ) @@ -1208,8 +1242,11 @@ class V4StateManagerAdaptor( override fun cancelOrder(orderId: String, callback: TransactionCallback) { val payload = cancelOrderPayload(orderId) val subaccount = stateMachine.state?.subaccount(subaccountNumber) - val existingOrder = subaccount?.orders?.firstOrNull { it.id == orderId } - val marketId = existingOrder?.marketId + val existingOrder = subaccount?.orders?.firstOrNull { it.id == orderId } ?: throw ParsingException( + ParsingErrorType.MissingRequiredData, + "no existing order to be cancelled for $orderId", + ) + val marketId = existingOrder.marketId val analyticsPayload = analyticsUtils.cancelOrderAnalyticsPayload( payload, existingOrder, @@ -1229,12 +1266,24 @@ class V4StateManagerAdaptor( payload.cancelOrderPayloads.forEach { cancelPayload -> val subaccount = stateMachine.state?.subaccount(subaccountNumber) val existingOrder = subaccount?.orders?.firstOrNull { it.id == cancelPayload.orderId } - val marketId = existingOrder?.marketId + ?: throw ParsingException( + ParsingErrorType.MissingRequiredData, + "no existing order to be cancelled for $cancelPayload.orderId", + ) + val marketId = existingOrder.marketId val cancelOrderAnalyticsPayload = analyticsUtils.cancelOrderAnalyticsPayload( cancelPayload, existingOrder, ) - submitCancelOrder(cancelPayload.orderId, marketId, callback, cancelPayload, cancelOrderAnalyticsPayload, uiClickTimeMs, true) + submitCancelOrder( + cancelPayload.orderId, + marketId, + callback, + cancelPayload, + cancelOrderAnalyticsPayload, + uiClickTimeMs, + true, + ) } payload.placeOrderPayloads.forEach { placePayload -> diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/utils/Payloads.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/utils/Payloads.kt index 71d20a9a1..d879d2b07 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/utils/Payloads.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/manager/utils/Payloads.kt @@ -63,8 +63,8 @@ data class HumanReadablePlaceOrderPayload( @Serializable data class HumanReadableCancelOrderPayload( val subaccountNumber: Int, - val orderId: String, val type: String, + val orderId: String, val clientId: Int, val orderFlags: Int, val clobPairId: Int, @@ -75,7 +75,7 @@ data class HumanReadableCancelOrderPayload( @JsExport @Serializable data class HumanReadableTriggerOrdersPayload( - val marketId: String?, + val marketId: String, val positionSize: Double?, val placeOrderPayloads: List, val cancelOrderPayloads: List, diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt index 56371b7da..4504dcfa9 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/state/v2/supervisor/SubaccountSupervisor.kt @@ -306,7 +306,11 @@ internal class SubaccountSupervisor( val interval = Clock.System.now().toEpochMilliseconds() .toDouble() - placeOrderRecord.timestampInMilliseconds tracking( - if (placeOrderRecord.isTriggerOrder) AnalyticsEvent.TriggerPlaceOrderConfirmed.rawValue else AnalyticsEvent.TradePlaceOrderConfirmed.rawValue, + if (placeOrderRecord.isTriggerOrder) { + AnalyticsEvent.TriggerPlaceOrderConfirmed.rawValue + } else { + AnalyticsEvent.TradePlaceOrderConfirmed.rawValue + }, ParsingHelper.merge( trackingParams(interval), orderAnalyticsPayload, @@ -322,7 +326,11 @@ internal class SubaccountSupervisor( val interval = Clock.System.now().toEpochMilliseconds() .toDouble() - cancelOrderRecord.timestampInMilliseconds tracking( - if (cancelOrderRecord.isTriggerOrder) AnalyticsEvent.TriggerCancelOrderConfirmed.rawValue else AnalyticsEvent.TradeCancelOrderConfirmed.rawValue, + if (cancelOrderRecord.isTriggerOrder) { + AnalyticsEvent.TriggerCancelOrderConfirmed.rawValue + } else { + AnalyticsEvent.TradeCancelOrderConfirmed.rawValue + }, ParsingHelper.merge( trackingParams(interval), orderAnalyticsPayload, @@ -539,7 +547,11 @@ internal class SubaccountSupervisor( val marketId = payload.marketId val position = stateMachine.state?.subaccount(subaccountNumber)?.openPositions?.find { it.id == marketId } - val positionSize = position?.size?.current + ?: throw ParsingException( + ParsingErrorType.MissingRequiredData, + "no open position for $marketId", + ) + val positionSize = position.size?.current val isShortTermOrder = when (payload.type) { "MARKET" -> true @@ -659,9 +671,17 @@ internal class SubaccountSupervisor( tracking( if (isCancel) { - if (isTriggerOrder) AnalyticsEvent.TriggerCancelOrder.rawValue else AnalyticsEvent.TradeCancelOrder.rawValue + if (isTriggerOrder) { + AnalyticsEvent.TriggerCancelOrder.rawValue + } else { + AnalyticsEvent.TradeCancelOrder.rawValue + } } else { - if (isTriggerOrder) AnalyticsEvent.TriggerPlaceOrder.rawValue else AnalyticsEvent.TradePlaceOrder.rawValue + if (isTriggerOrder) { + AnalyticsEvent.TriggerPlaceOrder.rawValue + } else { + AnalyticsEvent.TradePlaceOrder.rawValue + } }, ParsingHelper.merge(uiTrackingParams(uiDelayTimeMs), analyticsPayload) ?.toIMap(), @@ -679,18 +699,34 @@ internal class SubaccountSupervisor( if (error != null) { tracking( if (isCancel) { - if (isTriggerOrder) AnalyticsEvent.TriggerCancelOrderSubmissionFailed.rawValue else AnalyticsEvent.TradeCancelOrderSubmissionFailed.rawValue + if (isTriggerOrder) { + AnalyticsEvent.TriggerCancelOrderSubmissionFailed.rawValue + } else { + AnalyticsEvent.TradeCancelOrderSubmissionFailed.rawValue + } } else { - if (isTriggerOrder) AnalyticsEvent.TriggerPlaceOrderSubmissionFailed.rawValue else AnalyticsEvent.TradePlaceOrderSubmissionFailed.rawValue + if (isTriggerOrder) { + AnalyticsEvent.TriggerPlaceOrderSubmissionFailed.rawValue + } else { + AnalyticsEvent.TradePlaceOrderSubmissionFailed.rawValue + } }, ParsingHelper.merge(errorTrackingParams(error), analyticsPayload)?.toIMap(), ) } else { tracking( if (isCancel) { - if (isTriggerOrder) AnalyticsEvent.TriggerCancelOrderSubmissionConfirmed.rawValue else AnalyticsEvent.TradeCancelOrderSubmissionConfirmed.rawValue + if (isTriggerOrder) { + AnalyticsEvent.TriggerCancelOrderSubmissionConfirmed.rawValue + } else { + AnalyticsEvent.TradeCancelOrderSubmissionConfirmed.rawValue + } } else { - if (isTriggerOrder) AnalyticsEvent.TriggerPlaceOrderSubmissionConfirmed.rawValue else AnalyticsEvent.TradePlaceOrderSubmissionConfirmed.rawValue + if (isTriggerOrder) { + AnalyticsEvent.TriggerPlaceOrderSubmissionConfirmed.rawValue + } else { + AnalyticsEvent.TradePlaceOrderSubmissionConfirmed.rawValue + } }, analyticsPayload, ) @@ -699,7 +735,7 @@ internal class SubaccountSupervisor( private fun submitCancelOrder( orderId: String, - marketId: String?, + marketId: String, callback: TransactionCallback, payload: HumanReadableCancelOrderPayload, analyticsPayload: IMap?, @@ -710,7 +746,11 @@ internal class SubaccountSupervisor( val string = Json.encodeToString(payload) val position = stateMachine.state?.subaccount(subaccountNumber)?.openPositions?.find { it.id == marketId } - val positionSize = position?.size?.current + ?: throw ParsingException( + ParsingErrorType.MissingRequiredData, + "no open position for $marketId", + ) + val positionSize = position.size?.current stopWatchingLastOrder() @@ -795,8 +835,11 @@ internal class SubaccountSupervisor( internal fun cancelOrder(orderId: String, callback: TransactionCallback): HumanReadableCancelOrderPayload { val payload = cancelOrderPayload(orderId) val subaccount = stateMachine.state?.subaccount(subaccountNumber) - val existingOrder = subaccount?.orders?.firstOrNull { it.id == orderId } - val marketId = existingOrder?.marketId + val existingOrder = subaccount?.orders?.firstOrNull { it.id == orderId } ?: throw ParsingException( + ParsingErrorType.MissingRequiredData, + "no existing order to be cancelled for $orderId", + ) + val marketId = existingOrder.marketId val analyticsPayload = analyticsUtils.cancelOrderAnalyticsPayload(payload, existingOrder) val uiClickTimeMs = trackOrderClick(analyticsPayload, AnalyticsEvent.TradeCancelOrderClick) @@ -816,12 +859,24 @@ internal class SubaccountSupervisor( payload.cancelOrderPayloads.forEach { cancelPayload -> val subaccount = stateMachine.state?.subaccount(subaccountNumber) val existingOrder = subaccount?.orders?.firstOrNull { it.id == cancelPayload.orderId } - val marketId = existingOrder?.marketId + ?: throw ParsingException( + ParsingErrorType.MissingRequiredData, + "no existing order to be cancelled for $cancelPayload.orderId", + ) + val marketId = existingOrder.marketId val cancelOrderAnalyticsPayload = analyticsUtils.cancelOrderAnalyticsPayload( cancelPayload, existingOrder, ) - submitCancelOrder(cancelPayload.orderId, marketId, callback, cancelPayload, cancelOrderAnalyticsPayload, uiClickTimeMs, true) + submitCancelOrder( + cancelPayload.orderId, + marketId, + callback, + cancelPayload, + cancelOrderAnalyticsPayload, + uiClickTimeMs, + true, + ) } payload.placeOrderPayloads.forEach { placePayload -> @@ -1006,9 +1061,13 @@ internal class SubaccountSupervisor( val marketId = triggerOrders?.marketId ?: throw Exception("marketId is null") - val subaccount = stateMachine.state?.subaccount(subaccountNumber) ?: throw Exception("subaccount is null") - val position = helper.parser.asNativeMap(helper.parser.value(subaccount, "openPositions.$marketId")) - val positionSize = helper.parser.asDouble(helper.parser.value(position, "size.current")) + val subaccount = stateMachine.state?.subaccount(subaccountNumber) + val position = subaccount?.openPositions?.find { it.id == marketId } + ?: throw ParsingException( + ParsingErrorType.MissingRequiredData, + "no open position for $marketId", + ) + val positionSize = position.size?.current fun updateTriggerOrder(triggerOrder: TriggerOrder) { // Cases @@ -1019,7 +1078,7 @@ internal class SubaccountSupervisor( // 5. No existing order -> nothing should be done if (triggerOrder.orderId != null) { - val existingOrder = subaccount.orders?.firstOrNull { it.id == triggerOrder.orderId } + val existingOrder = subaccount?.orders?.firstOrNull { it.id == triggerOrder.orderId } ?: throw Exception("order is null") if (triggerOrder.price?.triggerPrice != null) { if (!isTriggerOrderEqualToExistingOrder(triggerOrder, existingOrder)) { @@ -1115,8 +1174,8 @@ internal class SubaccountSupervisor( return HumanReadableCancelOrderPayload( orderSubaccountNumber, - orderId, type, + orderId, clientId, orderFlags, clobPairId, diff --git a/src/commonMain/kotlin/exchange.dydx.abacus/utils/AnalyticsUtils.kt b/src/commonMain/kotlin/exchange.dydx.abacus/utils/AnalyticsUtils.kt index 976c514cf..5f07be767 100644 --- a/src/commonMain/kotlin/exchange.dydx.abacus/utils/AnalyticsUtils.kt +++ b/src/commonMain/kotlin/exchange.dydx.abacus/utils/AnalyticsUtils.kt @@ -5,12 +5,22 @@ import exchange.dydx.abacus.output.input.OrderType import exchange.dydx.abacus.state.manager.HumanReadableCancelOrderPayload import exchange.dydx.abacus.state.manager.HumanReadablePlaceOrderPayload import exchange.dydx.abacus.state.manager.HumanReadableTriggerOrdersPayload +import kollections.JsExport import kollections.toIMap - -enum class OrderAction(val rawValue: String) { - replace("REPLACE"), - cancel("CANCEL"), - create("CREATE"), +import kotlinx.serialization.Serializable + +@JsExport +@Serializable +enum class TriggerOrderAction(val rawValue: String) { + REPLACE("REPLACE"), + CANCEL("CANCEL"), + CREATE("CREATE"), + ; + + companion object { + operator fun invoke(rawValue: String?) = + TriggerOrderAction.values().firstOrNull { it.rawValue == rawValue } + } } class AnalyticsUtils { @@ -32,24 +42,32 @@ class AnalyticsUtils { val stopLossOrderTypes = listOf(OrderType.stopMarket, OrderType.stopLimit) val takeProfitOrderTypes = listOf(OrderType.takeProfitMarket, OrderType.takeProfitLimit) - var stopLossOrderAction: OrderAction? = null - var takeProfitOrderAction: OrderAction? = null + var stopLossOrderAction: TriggerOrderAction? = null + var takeProfitOrderAction: TriggerOrderAction? = null placeOrderPayloads.forEach { placePayload -> val orderType = OrderType.invoke(placePayload.type) if (stopLossOrderTypes.contains(orderType)) { - stopLossOrderAction = OrderAction.create + stopLossOrderAction = TriggerOrderAction.CREATE } else if (takeProfitOrderTypes.contains(orderType)) { - takeProfitOrderAction = OrderAction.create + takeProfitOrderAction = TriggerOrderAction.CREATE } } cancelOrderPayloads.forEach { cancelPayload -> val orderType = OrderType.invoke(cancelPayload.type) if (stopLossOrderTypes.contains(orderType)) { - stopLossOrderAction = if (stopLossOrderAction == null) OrderAction.cancel else OrderAction.replace + stopLossOrderAction = if (stopLossOrderAction == null) { + TriggerOrderAction.CANCEL + } else { + TriggerOrderAction.REPLACE + } } else if (takeProfitOrderTypes.contains(orderType)) { - takeProfitOrderAction = if (takeProfitOrderAction == null) OrderAction.cancel else OrderAction.replace + takeProfitOrderAction = if (takeProfitOrderAction == null) { + TriggerOrderAction.CANCEL + } else { + TriggerOrderAction.REPLACE + } } }