Showing 6 of 10 total issues
Function startFlow
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async startFlow(recipientAddress, amountToFlowString) {
const DAI_DECIMALS = await this.get_DAI_DECIMALS();
// decimals length cannot be bigger than allowed DAI_DECIMALS
const decimalSize = amountToFlowString.split(".")[1].length;
Function endFlow
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async endFlow(addressToRemove) {
const DAI_DECIMALS = await this.get_DAI_DECIMALS();
const balance_BN = await this.rDAIContract.balanceOf(this.userAddress);
Function getInfo
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getInfo(address) {
const balance_BN = await this.rDAIContract.balanceOf(address);
const unclaimedBalance_BN = await this.rDAIContract.interestPayableOf(
address
);
Function generate
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async generate(amountToTransferString) {
const DAI_DECIMALS = await this.get_DAI_DECIMALS();
// decimals length cannot be bigger than allowed DAI_DECIMALS
const decimalSize = amountToTransferString.split(".")[1].length;
Function startFlow
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
Open
async startFlow(recipientAddress, amountToFlowString) {
const DAI_DECIMALS = await this.get_DAI_DECIMALS();
// decimals length cannot be bigger than allowed DAI_DECIMALS
const decimalSize = amountToFlowString.split(".")[1].length;
- 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 endFlow
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
async endFlow(addressToRemove) {
const DAI_DECIMALS = await this.get_DAI_DECIMALS();
const balance_BN = await this.rDAIContract.balanceOf(this.userAddress);
- 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"