Showing 71 of 201 total issues
Function calcBaseInGivenDatatokensOut
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async calcBaseInGivenDatatokensOut(
exchangeId: string,
datatokenAmount: string,
consumeMarketFee: string = '0'
): Promise<PriceAndFees> {
Function buyDatatokens
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async buyDatatokens<G extends boolean = false>(
exchangeId: string,
datatokenAmount: string,
maxBaseTokenAmount: string,
consumeMarketAddress: string = ZERO_ADDRESS,
Function sellDatatokens
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async sellDatatokens<G extends boolean = false>(
exchangeId: string,
datatokenAmount: string,
minBaseTokenAmount: string,
consumeMarketAddress: string = ZERO_ADDRESS,
Function getConfig
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
public getConfig(network: string | number, infuraProjectId?: string): Config {
const filterBy = typeof network === 'string' ? 'network' : 'chainId'
let config = configHelperNetworks.find((c) => c[filterBy] === network)
- 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"
Further reading
Function getDownloadUrl
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async getDownloadUrl(
did: string,
serviceId: string,
fileIndex: number,
transferTxId: string,
Function getComputeResultUrl
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async getComputeResultUrl(
providerUri: string,
consumer: Signer,
jobId: string,
index: number
Function validate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async validate(ddo: DDO, signal?: AbortSignal): Promise<ValidateMetadata> {
const status: ValidateMetadata = {
valid: false
}
let jsonResponse
Function setMetadata
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async setMetadata<G extends boolean = false>(
nftAddress: string,
address: string,
metadataState: number,
metadataDecryptorUrl: string,
Function approve
has 9 arguments (exceeds 4 allowed). Consider refactoring. Open
signer: Signer,
config: Config,
account: string,
tokenAddress: string,
spender: string,
Function createNftWithDatatokenWithDispenser
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async createNftWithDatatokenWithDispenser<G extends boolean = false>(
nftCreateData: NftCreateData,
dtParams: DatatokenCreateParams,
dispenserParams: DispenserCreationParams,
estimateGas?: G
Function createDispenser
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async createDispenser<G extends boolean = false>(
dtAddress: string,
address: string,
dispenserAddress: string,
dispenserParams: DispenserParams,
Function startOrder
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
public async startOrder<G extends boolean = false>(
dtAddress: string,
consumer: string,
serviceIndex: number,
providerFees: ProviderFees,
Function createNFT
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public async createNFT<G extends boolean = false>(
nftData: NftCreateData,
estimateGas?: G
): Promise<G extends false ? string : BigNumber> {
if (!nftData.templateIndex) nftData.templateIndex = 1
- 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"
Further reading
Function computeStatus
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
public async computeStatus(
providerUri: string,
consumerAddress: string,
jobId?: string,
agreementId?: string,
- 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"
Further reading
Function transfer
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
signer: Signer,
config: Config,
tokenAddress: string,
recipient: string,
amount: string,
Function calculateActiveTemplateIndex
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export async function calculateActiveTemplateIndex(
owner: Signer,
nftContractAddress: string, // addresses.ERC721Factory,
template: string | number
): Promise<number> {
- 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"
Further reading
Function sendTx
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
estGas: BigNumber,
signer: Signer,
gasFeeMultiplier: number,
functionToSend: ContractFunction,
...args: any[]
Function computeDelete
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public async computeDelete(
did: string,
consumer: Signer,
jobId: string,
providerUri: string,
- 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"
Further reading
Function getOceanArtifactsAdressesByChainId
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function getOceanArtifactsAdressesByChainId(chain: number): any {
try {
// eslint-disable-next-line security/detect-non-literal-fs-filename
const data = getOceanArtifactsAdresses()
if (data) {
- 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"
Further reading
Function initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
public async initialize(
did: string,
serviceId: string,
fileIndex: number,
consumerAddress: string,
- 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"