Showing 1,820 of 4,015 total issues
Function add
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add(apiConfig, frame, options = {add: true}) {
debug('add');
if (_.get(frame,'options.source')) {
const html = frame.data.posts[0].html;
Function exports
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (event, model) => {
const _ = require('lodash');
const {sequence} = require('@tryghost/promise');
const api = require('../../api').endpoints;
const apiFramework = require('@tryghost/api-framework');
Function up
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
// This uses the default settings from core/server/data/schema/default-settings/default-settings.json
const newsletter = {
id: (new ObjectId()).toHexString(),
uuid: crypto.randomUUID(),
Function fetchBookmarkData
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async fetchBookmarkData(url, html) {
const gotOpts = {
headers: {
'User-Agent': USER_AGENT
}
Function UnsplashModal
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const UnsplashModal = NiceModal.create(() => {
const {updateRoute} = useRouting();
const {settings} = useGlobalData();
const [unsplashEnabled] = getSettingValues<boolean>(settings, ['unsplash']);
const {mutateAsync: editSettings} = useEditSettings();
Function Content
has 63 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const Content = () => {
const labs = useLabs();
const {t} = useAppContext();
const {pagination, member, comments, commentCount, commentsEnabled, title, showCount, secundaryFormCount} = useAppContext();
`` has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
export default Model.extend(Comparable, ValidationEngine, {
session: service(),
feature: service(),
ghostPaths: service(),
clock: service(),
StaffServiceEmails
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
class StaffServiceEmails {
constructor({logging, models, mailer, settingsHelpers, settingsCache, blogIcon, urlUtils, labs}) {
this.logging = logging;
this.models = models;
this.mailer = mailer;
exports
has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
module.exports = class EventRepository {
constructor({
DonationPaymentEvent,
EmailRecipient,
MemberSubscribeEvent,
`` has 23 functions (exceeds 20 allowed). Consider refactoring. Open
Open
User = ghostBookshelf.Model.extend({
tableName: 'users',
actionsCollectCRUD: true,
Function buildObjectTypeHandlers
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
buildObjectTypeHandlers(objTypes, actType, context, permissionLoad) {
const objectTypeModelMap = {
post: models.Post,
role: models.Role,
user: models.User,
Function unsubscribeController
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = async function unsubscribeController(req, res) {
debug('unsubscribeController');
const {query} = url.parse(req.url, true);
Function SortingForm
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const SortingForm: React.FC = () => {
const changeOrder = useOrderChange();
const [isOpen, setIsOpen] = useState(false);
const [selectedOption, setSelectedOption] = useState('best');
const dropdownRef = useRef<HTMLDivElement>(null);
File Users.tsx
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import React, {useEffect, useState} from 'react';
import TopLevelGroup from '../../TopLevelGroup';
import clsx from 'clsx';
import useQueryParams from '../../../hooks/useQueryParams';
import useStaffUsers from '../../../hooks/useStaffUsers';
File OffersIndex.tsx
has 269 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
import {Button, Tab, TabView} from '@tryghost/admin-x-design-system';
import {ButtonGroup, ButtonProps, showToast} from '@tryghost/admin-x-design-system';
import {Icon} from '@tryghost/admin-x-design-system';
import {Modal} from '@tryghost/admin-x-design-system';
import {SortMenu} from '@tryghost/admin-x-design-system';
Function getPortalPreviewUrl
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getPortalPreviewUrl(overrides) {
let {
disableBackground = false,
page = 'signup',
button = this.settings.portalButton,
Function populateStripePricesFromStripePlansSetting
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async populateStripePricesFromStripePlansSetting(options) {
if (!options) {
return this.models.Product.transaction((transacting) => {
return this.populateStripePricesFromStripePlansSetting({transacting});
});
Function connectAndSend
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports.connectAndSend = (socketAddress, message) => {
// Very basic guard against bad calls
if (!socketAddress || !socketAddress.host || !socketAddress.port || !logging || !logging.info || !logging.warn || !message) {
return Promise.resolve();
}
Function exports
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = function (Bookshelf) {
const ParentModel = Bookshelf.Model;
Bookshelf.Model = Bookshelf.Model.extend({
/**
Function useLimiter
has 61 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
export const useLimiter = () => {
const {config} = useGlobalData();
const [LimitService, setLimitService] = useState<typeof import('@tryghost/limit-service') | null>(null);
useEffect(() => {