Showing 1,820 of 4,015 total issues
Function edit
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
edit: function edit(data, unfilteredOptions) {
let options = this.filterOptions(unfilteredOptions, 'edit', {extraAllowedProperties: ['id']});
const editPost = () => {
options.forUpdate = true;
Function testImportThreshold
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async testImportThreshold() {
if (!isFinite(this._importTriggerThreshold)) {
// Infinite threshold, quick path
return;
}
Function query
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
query() {
/**
* @NOTE:
* We fetch all posts with `columns:id` to increase the speed of this endpoint.
* And if you trigger `post.destroy(..)`, this will trigger bookshelf and model events.
Function countRelations
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
countRelations() {
return {
posts(modelOrCollection) {
modelOrCollection.query('columns', 'newsletters.*', (qb) => {
qb.count('posts.id')
Function exports
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (Bookshelf) {
Bookshelf.Model = Bookshelf.Model.extend({
/**
* Return a relation, and load it if it hasn't been loaded already (or force a refresh with the forceRefresh option).
* refs https://github.com/TryGhost/Team/issues/1626
Function clickEventMapper
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const clickEventMapper = (json, frame) => {
const linkFields = [
'from',
'to'
];
Function serve
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
serve(options) {
const self = this;
return function downloadTheme(req, res, next) {
const themeName = options.name;
Function constructor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor({identifier, filter, resourceType, permalink, queue, resources, urls, position}) {
this.identifier = identifier;
this.resourceType = resourceType;
this.permalink = permalink;
this.queue = queue;
Function startFetch
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async startFetch() {
if (this.fetching) {
logging.info('Email analytics fetch already running, skipping');
return;
}
Function up
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
logging.info('Restoring member<>tier mapping for members with paid status');
try {
// fetch all members with a paid status that don't have a members_products record
// and have a members_product_events record with an action of "added"
Function up
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
const subscriptionsToUpdate = await knex('members_stripe_customers_subscriptions AS s')
.join('offers AS o', 's.offer_id', '=', 'o.id')
.where('o.duration', '=', 'forever')
.andWhere('s.mrr', '!=', 0)
Function up
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = createIrreversibleMigration(async function up(connection) {
if (DatabaseInfo.isMySQL(connection)) {
logging.info('Skipping removal of orphaned stripe records for MySQL');
return;
}
Function down
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function down(connection) {
const accessSetting = await connection('settings')
.where('key', 'members_signup_access')
.select('value')
.first();
Function doExport
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const doExport = async function doExport(options) {
options = options || {include: []};
try {
const tables = await commands.getTables(options.transacting);
Function up
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
logging.info('Adding existing subscribers to default newsletter');
const newsletter = await knex('newsletters')
.orderBy('sort_order', 'asc')
Function privateBlog
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const privateBlog = () => {
const ExpressBrute = require('express-brute');
const BruteKnex = require('brute-knex');
const db = require('../../../../data/db');
Function getState
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getState() {
let state = states.READY;
try {
await this.knexMigrator.isDatabaseOK();
return state;
Function handler
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function handler(siteApp) {
const verifyResourceType = function verifyResourceType(req, res, next) {
const resourceWithoutPage = req.params.resource.replace(/-\d+$/, '');
if (!Object.prototype.hasOwnProperty.call(manager, resourceWithoutPage)) {
return res.sendStatus(404);
Function StylesWrapper
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const StylesWrapper = () => {
return {
modalContainer: {
zIndex: '3999999',
position: 'fixed',
Function render
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const hasText = this.hasText();
const {member} = this.context;
const triggerBtnClass = member ? 'halo' : '';