Showing 1,820 of 4,015 total issues
Function handleObject
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleObject = (obj, key) => {
if (!Object.prototype.hasOwnProperty.call(obj, key)) {
return;
}
Function handleError
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handleError(errs, obj) {
let errorsToReject = [];
let problems = [];
// CASE: validation errors, see models/base/events.js onValidate
Function up
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = createTransactionalMigration(async function up(knex) {
// eslint-disable-next-line no-restricted-syntax
const compedMemberIds = (await knex('members')
.select('members.id')
.innerJoin(
Function viteConfig
has 55 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default (function viteConfig() {
return defineConfig({
logLevel: process.env.CI ? 'info' : 'warn',
plugins: [
svgr(),
File gh-uploader.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import Component from '@ember/component';
import EmberObject, {get} from '@ember/object';
import classic from 'ember-classic-decorator';
import ghostPaths from 'ghost-admin/utils/ghost-paths';
import {
File Base.js
has 258 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const debug = require('@tryghost/debug')('importer:base');
const _ = require('lodash');
const ObjectId = require('bson-objectid').default;
const errors = require('@tryghost/errors');
const {sequence} = require('@tryghost/promise');
File routes.js
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const express = require('../../../../../shared/express');
const api = require('../../../../api').endpoints;
const {http} = require('@tryghost/api-framework');
const apiMw = require('../../middleware');
const mw = require('./middleware');
File ImageSize.js
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const debug = require('@tryghost/debug')('utils:image-size');
const sizeOf = require('image-size');
const url = require('url');
const path = require('path');
ImportManager
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class ImportManager {
constructor() {
const mediaHandler = new ImporterContentFileHandler({
type: 'media',
// @NOTE: making the second parameter strict folder "content/media" brakes the glob pattern
Function mockUsers
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function mockUsers(server) {
// /users/me = Always return the user with ID=1
server.get('/users/me/', function ({users}) {
let user = users.find(1);
Function generateSlug
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
generateSlug: function generateSlug(Model, base, options) {
let slug;
let slugTryCount = 1;
const baseName = Model.prototype.tableName.replace(/s$/, '');
Function _onResourceUpdated
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async _onResourceUpdated(type, model) {
debug('_onResourceUpdated', type);
const resourceConfig = _.find(this.resourcesConfig, {type: type});
Function exports
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = async function (options) {
const hasFilter = options.limit !== 'all' || options.filter || options.search;
let ids = null;
if (hasFilter) {
Function up
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
const badVersionUsedFor40Migration = await knex('migrations')
.where({
name: '18-transform-urls-absolute-to-transform-ready.js'
})
Function up
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
logging.info('Updating members.status based on members_stripe_customers_subscriptions.status');
// eslint-disable-next-line no-restricted-syntax
const paidMemberIds = (await knex('members')
.select('members.id')
Function createPublicFileMiddleware
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function createPublicFileMiddleware(location, file, mime, maxAge, options = {}) {
let cache;
// These files are provided by Ghost, and therefore live inside of the core folder
const staticFilePath = config.get('paths').publicFilePath;
// These files are built on the fly, and must be saved in the content folder
File Resources.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
const _ = require('lodash');
const debug = require('@tryghost/debug')('services:url:resources');
const DomainEvents = require('@tryghost/domain-events');
const {URLResourceUpdatedEvent} = require('@tryghost/dynamic-routing-events');
const Resource = require('./Resource');
File ghost_head.js
has 256 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
// # Ghost Head Helper
// Usage: `{{ghost_head}}`
//
// Outputs scripts and other assets at the top of a Ghost theme
const {labs, metaData, settingsCache, config, blogIcon, urlUtils, getFrontendKey} = require('../services/proxy');
Function up
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
// eslint-disable-next-line no-restricted-syntax
const canceledSubscriptions = await knex('members_stripe_customers_subscriptions')
.select(
'members_stripe_customers_subscriptions.id',
Function EmailSuppressedPage
has 53 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export default function EmailSuppressedPage() {
const {brandColor, lastPage, onAction, action, site, t} = useContext(AppContext);
useEffect(() => {
if (['removeEmailFromSuppressionList:success'].includes(action)) {