Showing 80 of 183 total issues
Function parent
has 45 lines of code (exceeds 25 allowed). Consider refactoring. Open
parent () {
// Check integrity of hostedFields. If fields are dead or
// do not match chosen selectors, reset
let reset = (
this.hostedFields
Function getTieredPricingValues
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function getTieredPricingValues (
addOn,
selectedNumUnits,
currencyCode,
) {
Function activateKountProfile
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
activateKountProfile (params) {
debug('activating Kount profiles');
const configuredForm = this.recurly.config.fraud.kount.form;
const sessionIdInputElement = dom.createHiddenInput({
'data-recurly': 'fraud_session_id',
Function subscription
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
subscription (subscription) {
return new PricingPromise((resolve, reject) => {
if (!(subscription instanceof SubscriptionPricing)) {
return this.error(errors('invalid-option', {
name: 'subscription',
Function attach
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
attach (element) {
super.attach(element);
this.whenReady(() => {
Function token
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
function token (customerData, bus, done) {
debug('token');
debug('customerData', customerData);
const inputs = customerData.values;
Function getGoogleInfoFromMerchantInfo
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
const getGoogleInfoFromMerchantInfo = (recurlyMerchantInfo, options) => {
const { siteMode, paymentMethods } = recurlyMerchantInfo;
const { environment: envOpt, } = options;
const environment = envOpt || (siteMode === 'production' ? 'PRODUCTION' : 'TEST');
Function preflight
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
static preflight ({ recurly, number, jwt, deviceDataCollectionUrl }) {
const { preflightDeviceDataCollector } = recurly.config.risk.threeDSecure;
if(!preflightDeviceDataCollector) {
return Promise.resolve();
Function parent
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
parent () {
// Check integrity of hostedFields. If fields are dead or
// do not match chosen selectors, reset
let reset = (
this.hostedFields
- 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 plan
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
plan (...args) {
let { currentPlan, quantity, planCode, done } = this.subscription.resolvePlanOptions(...args);
return new PricingPromise((resolve, reject) => {
if (currentPlan && currentPlan.code === planCode) {
Function token
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function token (options, done) {
debug('token');
const data = normalize(options, FIELDS);
const inputs = data.values;
Function tokenDispatcher
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export function tokenDispatcher (...args) {
let bus, elements, customerData, done;
// signature variance
if (args[0] instanceof Elements) {
- 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 token
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function token (customerData, bus, done) {
debug('token');
debug('customerData', customerData);
const inputs = customerData.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 discountAmounts
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
discountAmounts () {
const coupon = this.items.coupon;
let discountNow = 0;
let discountNext = 0;
if (coupon) {
- 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 createAndMountWebComponent
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
async createAndMountWebComponent (paymentMethodData) {
const adyenOpts = this.options.adyen || {};
const checkout = await window.AdyenCheckout({
clientKey: adyenOpts.publicKey,
Function runner
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
function runner (config) {
const cfg = Object.assign({}, staticConfig, {
reporters: ['mocha'],
logLevel: config.LOG_INFO,
browsers: [BROWSER],
Function attach
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
attach (element) {
super.attach(element);
debug('Initiating 3D Secure frame');
const {
Function coupon
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
coupon (newCoupon, done) {
// If the new coupon matches the current one, we just need to ensure it
// still applies to the current plan
if (~this.couponCodes.indexOf(newCoupon)) {
return new PricingPromise((resolve, reject) => {
Function params
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
params (data) {
const { fraud: fraudConfig } = this.recurly.config;
let fraudParams = [];
debug('creating fraud params', data, fraudConfig);
Function tax
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
tax (done) {
this.price.now.tax = 0;
this.price.next.tax = 0;
// If tax amount has been specified, simply apply it