Showing 1,820 of 4,015 total issues
Function notifyPaidSubscriptionCanceled
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async notifyPaidSubscriptionCanceled({member, tier, subscription, cancelNow, expiryAt, canceledAt}, options = {}) {
const users = await this.models.User.getEmailAlertUsers('paid-canceled', options);
for (const user of users) {
const to = user.email;
Function read
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async read(data, options = {}) {
const defaultWithRelated = [
'labels',
'stripeSubscriptions',
'stripeSubscriptions.customer',
Function author
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const author = (attrs, frame) => {
if (localUtils.isContentAPI(frame)) {
delete attrs.created_at;
delete attrs.updated_at;
delete attrs.last_seen;
Function getConfig
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getConfig({config, urlUtils, settingsHelpers}) {
/**
* @returns {StripeURLConfig}
*/
function getStripeUrlConfig() {
Function exports
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = createIrreversibleMigration(async (knex) => {
logging.info('Starting re-generation of posts html.');
await knex.transaction(async (trx) => {
// get list of posts ids, use .forUpdate to lock rows until the transaction is finished
Function SupportPage
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const SupportPage = () => {
const [isLoading, setLoading] = useState(true);
const [error, setError] = useState(null);
const [disabledFeatureError, setDisabledFeatureError] = useState(null);
const {member, t, site} = useContext(AppContext);
Function ContinueSubscriptionButton
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const ContinueSubscriptionButton = () => {
const {member, onAction, action, brandColor, t} = useContext(AppContext);
const subscription = getMemberSubscription({member});
if (!subscription) {
return null;
Function initSetup
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async initSetup() {
try {
// Fetch data from API, links, preview, dev sources
const {site, member, page, showPopup, popupNotification, lastPage, pageQuery, pageData} = await this.fetchData();
const i18nLanguage = this.props.siteI18nEnabled ? site.locale : 'en';
Function generate
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generate() {
let timestamp = this.events.pop();
if (!timestamp) {
return;
}
Function createCheckoutSession
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async createCheckoutSession(priceId, customer, options) {
const metadata = options.metadata || undefined;
const customerId = customer ? customer.id : undefined;
const customerEmail = customer ? customer.email : options.customerEmail;
Function notifyMilestoneReceived
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async notifyMilestoneReceived({milestone}) {
if (!milestone?.emailSentAt || milestone?.meta?.reason) {
// Do not send an email when no email was set to be sent or a reason
// not to send provided
return;
Function handleMismatch
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async handleMismatch({acceptVersion, contentVersion, apiKeyValue, apiKeyType, requestURL, userAgent = ''}) {
if (!await this.versionNotificationsDataService.fetchNotification(acceptVersion)) {
const integration = await this.versionNotificationsDataService.getIntegration(apiKeyValue, apiKeyType);
// We couldn't find the integration
Function query
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async query(frame) {
const store = storage.getStorage('images');
// Normalize
const imageOptimizationOptions = config.get('imageOptimization');
Function exports
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (Bookshelf) {
Bookshelf.Model = Bookshelf.Model.extend({
getActor(options = {context: {}}) {
if (options.context && options.context.integration) {
return {
Function add
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async add(attrs, options = {}) {
// create newsletter and assign members in the same transaction
if (options.opt_in_existing && !options.transacting) {
return this.NewsletterModel.transaction((transacting) => {
options.transacting = transacting;
Function run
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
run(options) {
const {event, action, eventData} = options;
clearTimeout(this.toNotify[action].timeout);
this.toNotify[action].timeout = null;
Function destroyUser
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async destroyUser(frameOptions) {
let filename = null;
const backupPath = await this.dbBackup.backup();
if (backupPath) {
Function addPermissionToRoleHelper
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function addPermissionToRoleHelper(connection, config) {
const permission = await connection('permissions').where({
name: config.permission
}).first();
Function up
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
// Backfill missing offer redemptions
try {
// Select all subscriptions that have an `offer_id` but don't have a matching row in the `offer_redemptions` table
logging.info('Selecting subscriptions with missing offer redemptions');
Function collectionController
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function collectionController(req, res, next) {
debug('collectionController beging', req.params, res.routerOptions);
const pathOptions = {
page: req.params.page !== undefined ? req.params.page : 1,