Showing 1,820 of 4,015 total issues
Function _handleTokenRequest
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_handleTokenRequest() {
const handleNoPermission = () => {
// no permission means the current user requesting the token is not the owner of the site.
this.isOwner = false;
Function serialize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
serialize(snapshot/*, options*/) {
let json = super.serialize(...arguments);
// Inserted locally as a convenience.
delete json.author_id;
Function _updateGrow
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_updateGrow(settings) {
const change = Math.round(Math.random() * (settings.growRate - settings.shrinkOffset));
if (settings.growPeriod) {
settings.growCount += 1;
Function updateRevisions
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
ops.push(async function updateRevisions() {
const revisionModels = await ghostBookshelf.model('PostRevision')
.findAll(Object.assign({
filter: `post_id:'${model.id}'`,
columns: ['id', 'lexical', 'created_at', 'author_id', 'title', 'reason', 'post_status', 'created_at_ts', 'feature_image']
Function defaults
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
defaults: function defaults() {
let visibility = 'public';
let tiers = [];
const defaultContentVisibility = settingsCache.get('default_content_visibility');
if (defaultContentVisibility) {
Function read
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
read(options) {
options = options || {};
// remove trailing slashes
options.path = (options.path || '').replace(/\/$|\\$/, '');
Function init
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init() {
if (this.api) {
// Prevent creating duplicate DomainEvents subscribers
return;
}
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (model, frame) => {
const jsonModel = model.toJSON(frame.options);
if (utils.isContentAPI(frame)) {
const serialized = {
Function destroy
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
destroy({notificationId, user}) {
const allNotifications = this.fetchAllNotifications();
const notificationToMarkAsSeen = allNotifications.find((notification) => {
return notification.id === notificationId;
Function sendWelcomeEmail
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function sendWelcomeEmail(email, mailAPI) {
if (config.get('sendWelcomeEmail')) {
const data = {
ownerEmail: email
};
Function doTiersAndNewsletter
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function doTiersAndNewsletter(data, api) {
const {tiers: tiersAPI, newsletters: newslettersAPI} = api;
const context = {context: {user: data.user.id}};
const user = data.user;
const blogTitle = data.userData.blogTitle;
Function exports
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = createIrreversibleMigration(async (knex) => {
if (!DatabaseInfo.isSQLite(knex)) {
return logging.warn('Skipping fixing foreign key for members_stripe_customers_subscriptions - database is not SQLite3');
}
Function up
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
if (!DatabaseInfo.isMySQL(knex)) {
logging.warn('Skipping cleanup of duplicate offer redemptions - database is not MySQL');
return;
}
Function getCachedImageSizeFromUrl
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getCachedImageSizeFromUrl(url) {
if (!url || url === undefined || url === null) {
return;
}
Function up
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
logging.info('Updating members_status_events for comped members');
const compedMembers = await knex('members')
.select('id')
.where('status', 'comped');
Function addFixturesForModel
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async addFixturesForModel(modelFixture, options = {}) {
// Clone the fixtures as they get changed in this function.
// The initial blog posts will be added a `published_at` property, which
// would change the fixturesHash.
modelFixture = _.cloneDeep(modelFixture);
Function getUnsplashImage
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.getUnsplashImage = function getUnsplashImage(imagePath, sizeOptions) {
const parsedUrl = new URL(imagePath);
const {requestedSize, imageSizes, requestedFormat} = sizeOptions;
if (requestedFormat) {
Function loadNconf
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function loadNconf(options) {
debug('config start');
options = options || {};
const baseConfigPath = options.baseConfigPath || __dirname;
Function tiers
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function tiers(options = {}) {
options = options || {};
options.hash = options.hash || {};
const separator = isString(options.hash.separator) ? options.hash.separator : ', ';
Function getAssetUrl
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getAssetUrl(path, hasMinFile) {
path = path instanceof SafeString ? path.string : path;
// CASE: favicon - this is special path with its own functionality
if (path.match(/\/?favicon\.(ico|png)$/)) {