Showing 80 of 183 total issues
Function validateOptions
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
async validateOptions () {
const getMissingField = (options, fields) => {
for(const field of fields) {
if (!(field in options)) {
return field;
Function constructor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor (pricing, done) {
this.pricing = pricing;
this.items = pricing.items;
this._itemizedSets = { now: {}, next: {} };
Function buildApplePayPaymentRequest
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function buildApplePayPaymentRequest (applePay, options, cb) {
const { recurly, config } = applePay;
const paymentRequest = {
currencyCode: options.currency,
countryCode: options.country,
Function token
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function token (options, done) {
debug('token');
const data = normalize(options, FIELDS);
const inputs = data.values;
- 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 addon
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
addon (addonCode, meta, done) {
if (typeof meta === 'function') {
done = meta;
meta = undefined;
}
Function constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor (pricing, done) {
this.pricing = pricing;
this.items = pricing.items;
this.price = {
Function discountableSubtotals
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
discountableSubtotals (coupon, { setupFees = true, taxExempt = true } = {}) {
let discountableNow = 0;
let discountableNext = 0;
// adjustments
Function toLegacyLauncher
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function toLegacyLauncher (capability) {
const capabilities = Object.assign({}, capability);
const translations = {
browserName: 'browser',
browserVersion: 'browser_version',
Function getHostedFieldParentForm
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
getHostedFieldParentForm () {
if (this._form) return this._form;
const fields = this.recurly.config.fields;
debug('form fields', fields);
const selectors = Object.keys(fields)
Function initialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
initialize () {
debug('Initializing Braintree client');
const authorization = this.config.clientAuthorization;
const braintree = window.braintree;
Function discountableSubtotals
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
discountableSubtotals (coupon, { setupFees = true, taxExempt = true } = {}) {
let discountableNow = 0;
let discountableNext = 0;
// adjustments
- 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 valueGet
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function valueGet (node) {
node = element(node);
var nodeType = node && node.type && node.type.toLowerCase();
var value;
- 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 buildApplePayPaymentRequest
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export default function buildApplePayPaymentRequest (applePay, options, cb) {
const { recurly, config } = applePay;
const paymentRequest = {
currencyCode: options.currency,
countryCode: options.country,
- 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 payWithGoogle
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
const payWithGoogle = ({ paymentOptions, isReadyToPayRequest, paymentDataRequest, buttonOptions }) => {
const { paymentDataCallbacks } = paymentOptions;
if (paymentDataCallbacks) {
const { onPaymentAuthorized, onPaymentDataChanged } = paymentDataCallbacks;
- 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 element
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function element (node) {
var jQuery = window.jQuery;
var isJQuery = jQuery && node instanceof jQuery;
var isElem;
- 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 taxes
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
taxes () {
let taxNow = this.price.now.taxes = 0;
let taxNext = this.price.next.taxes = 0;
// If tax amount has been specified, simply apply it
- 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 tokens
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function tokens () {
const params = this.method === 'GET' ? this.query : this.request.body;
const { type } = params;
if (type === 'iban_bank_account') {
- 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 classList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
get classList () {
const prefix = 'recurly-hosted-field';
let classes = [prefix];
if (this.ready) {
- 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 classList
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
get classList () {
const { attached, state, type } = this;
const prefix = 'recurly-element';
let classes = [prefix];
- 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 configure
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
configure (options) {
if (!(options.recurly instanceof Recurly)) throw this.error('paypal-factory-only');
this.recurly = options.recurly;
if (options.gatewayCode) this.config.gatewayCode = options.gatewayCode;
- 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"