Showing 1,820 of 4,015 total issues
Function shortToLongForm
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const shortToLongForm = (shortForm, options = {}) => {
let longForm = {
query: {},
router: {}
};
Function add
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add(options) {
const {url, generatorId, resource} = options;
debug('add', resource.data.id, url);
if (this.urls[resource.data.id]) {
Function save
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async save(offer, options) {
/** @type any */
const data = {
id: offer.id,
name: offer.name.value,
Function init
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const init = () => {
let helpLink;
if (config.get('hostSettings:billing:enabled') && config.get('hostSettings:billing:enabled') === true && config.get('hostSettings:billing:url')) {
helpLink = config.get('hostSettings:billing:url');
Function setupApiApp
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function setupApiApp() {
debug('Admin API setup start');
const apiApp = express('admin api');
// API middleware
Function populateImageSizes
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
populateImageSizes: async function (mobiledocJson) {
// do not require image-size until it's requested to avoid circular dependencies
// shared/url-utils > server/lib/mobiledoc > server/lib/image/image-size > server/adapters/storage/utils
const {imageSize} = require('./image');
Function up
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
const membersWithProduct = await knex
.select('id')
.from('members')
.whereIn('status', ['comped', 'paid']);
Function tags
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function tags(options) {
options = options || {};
options.hash = options.hash || {};
const autolink = !(isString(options.hash.autolink) && options.hash.autolink === 'false');
Function initNestDependencies
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function initNestDependencies() {
debug('Begin: initNestDependencies');
const GhostNestApp = require('@tryghost/ghost');
const providers = [];
providers.push({
Function getPostSchema
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getPostSchema(metaData, data) {
// CASE: metaData.excerpt for post context is populated by either the custom excerpt, the meta description,
// or the automated excerpt of 50 words. It is empty for any other context.
const description = metaData.excerpt ? escapeExpression(metaData.excerpt) : null;
Function corsOptionsDelegate
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function corsOptionsDelegate(req, callback) {
const origin = req.header('Origin');
const corsOptions = {
origin: false, // disallow cross-origin requests by default
credentials: true, // required to allow admin-client to login to private sites
Function EmailPreferencesAction
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function EmailPreferencesAction() {
const {onAction, member, t} = useContext(AppContext);
const emailSuppressed = isEmailSuppressed({member});
const page = emailSuppressed ? 'emailSuppressed' : 'accountEmail';
Function render
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render() {
const {pageData: offer, site, t} = this.context;
if (!offer) {
return null;
}
Function handleDelete
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const handleDelete = async () => {
NiceModal.show(ConfirmationModal, {
title: 'Are you sure you want to delete this?',
prompt: (
<>
Function renderSenderEmailField
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const renderSenderEmailField = () => {
// Self-hosters, or legacy Pro users
if (!isManagedEmail(config)) {
return (
<TextField
Function compute
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
compute([event, hasMultipleNewsletters]) {
const subject = event.data.member ? (event.data.member.name || event.data.member.email) : (event.data.name || event.data.email || '');
const icon = this.getIcon(event);
const action = this.getAction(event, hasMultipleNewsletters);
const info = this.getInfo(event);
Function getTypeAndIdFromPath
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getTypeAndIdFromPath(path) {
const resource = this.urlService.getResource(path);
if (!resource) {
return;
}
Function drag
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
@action
drag(e) {
e.preventDefault();
let eventX, eventY;
Function subscribeEvents
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
subscribeEvents() {
// Trigger email for free member signup
this.DomainEvents.subscribe(MemberCreatedEvent, async (event) => {
try {
await this.handleEvent(MemberCreatedEvent, event);
Function serveStaticContent
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
return function serveStaticContent(req, res, next) {
return serveStatic(
storagePath,
{
maxAge: constants.ONE_YEAR_MS,