Showing 1,820 of 4,015 total issues
Function edit
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async edit(data, options) {
delete data.last_seen_at;
let model;
Function permissible
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
permissible: function permissible(roleModelOrId, action, context, unsafeAttrs, loadedPermissions, hasUserPermission, hasApiKeyPermission) {
// If we passed in an id instead of a model, get the model
// then check the permissions
if (_.isNumber(roleModelOrId) || _.isString(roleModelOrId)) {
// Get the actual role model
Function getEmailSentEvents
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getEmailSentEvents(options = {}, filter) {
const filterStr = 'failed_at:null+processed_at:-null+delivered_at:null+custom:true';
options = {
...options,
withRelated: ['member', 'email'],
Function init
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
init() {
if (this.service) {
// Already done
return;
}
Function getBulkAction
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
getBulkAction(event, count, options) {
const actor = this.prototype.getActor(options);
// @NOTE: we ignore internal updates (`options.context.internal`) for now
if (!actor) {
Function icon
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const icon = (frame) => {
const iconExtensions = (config.get('uploads').icons && config.get('uploads').icons.extensions) || [];
// We don't support resizing .ico files, so we set a lower max upload size
const isIco = frame.file.ext.toLowerCase() === '.ico';
Function add
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
add(frame) {
const object = frame.data;
if (!object || !object.username || !object.password) {
return Promise.reject(new errors.UnauthorizedError({
Function nonePublicAuth
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const nonePublicAuth = (apiConfig, frame) => {
debug('check admin permissions');
let singular;
if (apiConfig.docName.match(/ies$/)) {
Function trigger
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async trigger(event, model) {
const response = {
onSuccess: this.onSuccess.bind(this),
onError: this.onError.bind(this)
};
Function mapToOffer
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async mapToOffer(model, options) {
const json = model.toJSON();
const count = await this.OfferRedemptionModel.where({offer_id: json.id}).count('id', {
transacting: options.transacting
});
Function getOEmbedData
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async getOEmbedData(url, externalRequest) {
if (url.host === 'x.com') { // api is still at twitter.com... also not certain how people are getting x urls because twitter currently redirects every x host to twitter
url = new URL('https://twitter.com' + url.pathname);
}
Function installFromGithub
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const installFromGithub = async (ref) => {
const [org, repo] = ref.toLowerCase().split('/');
//TODO: move the organization check to config
if (limitService.isLimited('customThemes') && org.toLowerCase() !== 'tryghost') {
Function check
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const check = async function check(themeName, theme, options = {}) {
debug('Begin: Check');
// gscan can slow down boot time if we require on boot, for now nest the require.
const gscan = require('gscan');
const checkedVersion = 'v5';
Function constructor
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor() {
const mediaHandler = new ImporterContentFileHandler({
type: 'media',
// @NOTE: making the second parameter strict folder "content/media" brakes the glob pattern
// in the importer, so we need to keep it as general "content" unless
Function constructor
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
constructor(allDataFromFile, options) {
this.options = options;
this.modelName = options.modelName;
// Problems are currently constructed but not displayed to the user
Function up
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
logging.info('Adding Admin API key for "Self-Serve Migration Integration"');
const integration = await knex('integrations').where({
slug: 'self-serve-migration',
Function up
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
async function up(knex) {
logging.info('Adding Admin API key for Ghost Explore Integration');
const integration = await knex('integrations').where({
slug: 'ghost-explore',
Function exports
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = createIrreversibleMigration(async (knex) => {
logging.info('Adding version to posts.mobiledoc objects and cleaning up deprecated card names');
await knex.transaction(async (trx) => {
// get list of posts ids, use .forUpdate to lock rows until the transaction is finished
Function replaceIdentifiers
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
replaceIdentifiers() {
debug('replaceIdentifiers');
// map product_id -> product.id
let invalidProducts = [];
Function populatePriceData
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
populatePriceData() {
const invalidRows = [];
_.each(this.dataToImport, (row) => {
if (row.slug === 'free') {
return;