Showing 1,820 of 4,015 total issues
Function parseNqlFilter
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
parseNqlFilter: (flt) => {
const comparator = flt.$and || flt.$or; // $or for legacy filter backwards compatibility
if (!comparator || comparator.length !== 2) {
const filter = flt;
Function onTitleKeydown
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@action
onTitleKeydown(event) {
if (this.feature.editorExcerpt) {
// move cursor to the excerpt on
// - Tab (handled by browser)
Function model
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
model(params) {
let signupDetails = SignupDetails.create();
let re = /^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2}|[A-Za-z0-9_-]{3})?$/;
let email,
tokenText;
Function handleInvoiceEvent
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async handleInvoiceEvent(invoice) {
const {api, memberRepository, eventRepository, productRepository} = this.deps;
if (!invoice.subscription) {
// Check if this is a one time payment, related to a donation
Function subscribe
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
subscribe(domainEvents) {
domainEvents.subscribe(MemberPageViewEvent, async (event) => {
try {
await this.cachedUpdateLastSeenAt(event.data.memberId, event.data.memberLastSeenAt, event.timestamp);
} catch (err) {
Function mappedRows
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const mappedRows = rows.map((row) => {
if (row.error && !columns.includes('error')) {
columns.push('error');
}
Function notifyFreeMemberSignup
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async notifyFreeMemberSignup({
member, attribution
}, options) {
const users = await this.models.User.getEmailAlertUsers('free-signup', options);
Function _execute
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
SchedulingDefault.prototype._execute = function (jobs) {
const keys = Object.keys(jobs);
const self = this;
keys.forEach(function (timestamp) {
Function createSubscription
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async createSubscription(data, options) {
if (!this._stripeAPIService.configured) {
throw new errors.BadRequestError({message: tpl(messages.noStripeConnection, {action: 'create Stripe Subscription'})});
}
const member = await this._Member.findOne({
Function getPriceForTierCadence
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getPriceForTierCadence(tier, cadence) {
const product = await this.getProductForTier(tier);
const currency = tier.currency.toLowerCase();
const amount = tier.getPrice(cadence);
const rows = await this.StripePriceModel.where({
Function emitChange
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
emitChange: function (model, event, options) {
const _emit = (ghostEvent, _model, opts) => {
if (!_model.wasChanged()) {
return;
}
Function attach
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const attach = function attach(Model, effectedModelId, relation, modelsToAttach, options) {
options = options || {};
let fetchedModel;
const localOptions = {transacting: options.transacting};
Function read
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
read(key, context) {
let setting;
if (key === 'slack') {
const slackURL = this.settingsCache.get('slack_url', {resolve: false});
Function edit
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async edit(data, options) {
if (options.keyid) {
const model = await this.ApiKeyModel.findOne({id: options.keyid});
if (!model) {
Function initVerificationTrigger
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const initVerificationTrigger = () => {
return new VerificationTrigger({
getApiTriggerThreshold: () => _.get(config.get('hostSettings'), 'emailVerification.apiThreshold'),
getAdminTriggerThreshold: () => _.get(config.get('hostSettings'), 'emailVerification.adminThreshold'),
getImportTriggerThreshold: () => _.get(config.get('hostSettings'), 'emailVerification.importThreshold'),
Function filterPrivateRoutes
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
filterPrivateRoutes: function filterPrivateRoutes(req, res, next) {
// If this site is not in private mode, skip
if (!res.isPrivateBlog) {
return next();
}
Function generateItem
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const generateItem = function generateItem(post) {
const cheerio = require('cheerio');
const itemUrl = routerManager.getUrlByResourceId(post.id, {absolute: true});
const htmlContent = cheerio.load(post.html || '');
Function channelController
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function channelController(req, res, next) {
debug('channelController', req.params, res.routerOptions);
const pathOptions = {
page: req.params.page !== undefined ? req.params.page : 1,
Function EmailNewsletterAction
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function EmailNewsletterAction() {
const {member, site, onAction, t} = useContext(AppContext);
let {newsletters} = member;
const subscribed = !!newsletters?.length;
Function useStaffUsers
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const useStaffUsers = (): UsersHook => {
const {currentUser} = useGlobalData();
const {data: {users, meta, isEnd} = {users: []}, isLoading: usersLoading, fetchNextPage} = useBrowseUsers();
const {data: {invites} = {invites: []}, isLoading: invitesLoading} = useBrowseInvites();
const {data: {roles} = {}, isLoading: rolesLoading} = useBrowseRoles();