Showing 1,820 of 4,015 total issues
Function checkoutDonation
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async checkoutDonation({successUrl, cancelUrl, metadata = {}} = {}) {
const identity = await api.member.identity();
const url = endpointFor({type: 'members', resource: 'create-stripe-checkout-session'});
const metadataObj = {
Function emailPostController
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function emailPostController(req, res, next) {
debug('emailPostController');
const api = require('../../proxy').api;
Function dispatchAction
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async dispatchAction(action, data) {
clearTimeout(this.timeoutId);
this.setState({
action: `${action}:running`
});
Function renderProductCard
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
renderProductCard({product, offer, currencyClass, updatedPrice, price, benefits}) {
const {t} = this.context;
if (this.state.showNewsletterSelection) {
return null;
Function injectContentIntoIframe
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const injectContentIntoIframe = useCallback((iframe: HTMLIFrameElement) => {
if (!url || !previewData) {
return;
}
Function updateOffer
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async updateOffer(data, options = {}) {
return await this.repository.createTransaction(async (transaction) => {
const updateOptions = {...options, transacting: transaction};
const uniqueChecker = new UniqueChecker(this.repository, transaction);
Function codemirrorAssets
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const codemirrorAssets = function () {
let codemirrorFiles = [
'lib/codemirror.js',
'mode/htmlmixed/htmlmixed.js',
'mode/xml/xml.js',
Function paginateModelCollection
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export function paginateModelCollection(modelName, collection, page, limit) {
let pages, next, prev, models;
if (limit === 'all') {
pages = 1;
Function amount
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
amount(model) {
if (model.amount === '' || model.amount === undefined) {
model.errors.add('amount', 'Please enter the amount.');
return this.invalidate();
Function validate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
validate(opts) {
let model = this;
let hasValidated,
type,
validator;
Function parse
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function parse(path) {
let source;
let json;
try {
Function minify
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async minify(globs, options) {
debug('Begin', globs);
const destinations = Object.keys(globs);
const minifiedFiles = [];
Function subscribe
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
subscribe(domainEvents) {
domainEvents.subscribe(MemberCreatedEvent, async (event) => {
let attribution = event.data.attribution;
await this.models.MemberCreatedEvent.add({
Function updateCheckData
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async updateCheckData() {
let data = {};
let mailConfig = this.config.mail;
data.ghost_version = this.config.ghostVersion;
Function onUpdating
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
onUpdating: function onUpdating(model, attr, options) {
if (this.relationships) {
model.changed = _.omit(model.changed, this.relationships);
}
Function findOne
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
findOne: function findOne(dataToClone, unfilteredOptions) {
const options = this.filterOptions(unfilteredOptions, 'findOne');
let query;
let status;
let data = _.cloneDeep(dataToClone);
Function createBulkOperation
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createBulkOperation(singular, multiple) {
return async function (knex, table, data, options) {
const result = {
successful: 0,
unsuccessful: 0,
Function setAccessCookies
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const setAccessCookies = function setAccessCookies(member, req, res, freeTier) {
if (!member) {
// If there is no cookie sent with the request, return early
if (!req.headers.cookie || !req.headers.cookie.includes('ghost-access')) {
return;
Function init
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async init() {
this.Suppression = models.Suppression;
const handleEvent = reason => async (event) => {
try {
if (reason === 'bounce') {
Function getLastEventTimestamp
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getLastEventTimestamp(jobName, events = ['delivered', 'opened', 'failed']) {
const startDate = new Date();
let maxOpenedAt;
let maxDeliveredAt;