Showing 71 of 71 total issues
Method show
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
ReadableMap paymentMethodData,
ReadableMap details,
ReadableMap options,
Callback errorCallback,
Callback successCallback
Function _getPlatformDetailsIOS
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_getPlatformDetailsIOS(details: PaymentDetailsIOSRaw): PaymentDetailsIOS {
const {
paymentData: serializedPaymentData,
billingContact: serializedBillingContact,
shippingContact: serializedShippingContact,
- 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 _handleUserAccept
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_handleUserAccept(details: {
transactionIdentifier: string,
paymentData: string,
shippingAddress: Object,
payerEmail: 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
Avoid too many return
statements within this function. Open
return false;
Avoid too many return
statements within this function. Open
return true;
Avoid too many return
statements within this function. Open
return false;
Function convertDetailAmountsToString
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function convertDetailAmountsToString(
details: PaymentDetailsInit
): PaymentDetailsInit {
const nextDetails = Object.keys(details).reduce((acc, key) => {
if (key === 'total') {
- 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 updateWith
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async updateWith(
PaymentDetailsModifierOrPromise:
| PaymentDetailsUpdate
| ((
PaymentDetailsModifier,
- 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
Method show
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
@ReactMethod
public void show(
ReadableMap paymentMethodData,
ReadableMap details,
ReadableMap options,
- 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 validateTotal
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function validateTotal(total, errorType = Error): void {
// Should Vailidator take an errorType to prepopulate "Failed to construct 'PaymentRequest'"
if (total === undefined) {
throw new errorType(`required member total is undefined.`);
- 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 hasGatewayConfig
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function hasGatewayConfig(platformMethodData = {}) {
if (!platformMethodData) {
return false;
}
- 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"