TryGhost/Ghost

View on GitHub

Showing 1,756 of 3,886 total issues

Avoid too many return statements within this function.
Open

            return await this._Product.findOne({id: data.id}, options);
Severity: Major
Found in ghost/members-api/lib/repositories/ProductRepository.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

                return await stripeProduct.related('product').fetch(options);
    Severity: Major
    Found in ghost/members-api/lib/repositories/ProductRepository.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

              return sequence(ops);
      Severity: Major
      Found in ghost/core/core/server/models/post.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

                            return next(new errors.InternalServerError({err: err}));
        Severity: Major
        Found in ghost/core/core/server/adapters/storage/LocalStorageBase.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                                  return Promise.reject(
                                      new errors.ValidationError({
                                          message: tpl(messages.invalidRoleValue.message),
                                          context: tpl(messages.invalidRoleValue.context),
                                          help: tpl(messages.invalidRoleValue.help)
          Severity: Major
          Found in ghost/core/core/server/models/user.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                                    return Promise.resolve();
            Severity: Major
            Found in ghost/core/core/server/models/user.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                          return Promise.resolve();
              Severity: Major
              Found in ghost/core/core/server/models/user.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                            return User.getOwnerUser()
                                .then((owner) => {
                                    // CASE: owner can assign role to any user
                                    if (context.user === owner.id) {
                                        if (hasUserPermission && hasApiKeyPermission) {
                Severity: Major
                Found in ghost/core/core/server/models/user.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                      return event;

                    Avoid too many return statements within this function.
                    Open

                            return Promise.reject(new errors.NoPermissionError({
                                message: tpl(messages.notEnoughPermission)
                            }));
                    Severity: Major
                    Found in ghost/core/core/server/models/user.js - About 30 mins to fix

                      Avoid too many return statements within this function.
                      Open

                                          return Promise.reject(new errors.NoPermissionError({
                                              message: tpl(messages.notEnoughPermission)
                                          }));
                      Severity: Major
                      Found in ghost/core/core/server/models/user.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return hasMemberPermission;
                        Severity: Major
                        Found in ghost/core/core/server/models/comment.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                                  return PERMIT_ACCESS;
                          Severity: Major
                          Found in ghost/core/core/server/services/members/content-gating.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return BLOCK_ACCESS;
                            Severity: Major
                            Found in ghost/core/core/server/services/members/content-gating.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return '/404/';
                              Severity: Major
                              Found in ghost/core/core/server/services/url/UrlService.js - About 30 mins to fix

                                Avoid too many return statements within this function.
                                Open

                                                return Promise.reject(new errors.InternalServerError({
                                                    message: 'Unknown Request error.',
                                                    code: 'IMAGE_SIZE_URL',
                                                    statusCode: err.statusCode,
                                                    context: err.url || imagePath,
                                Severity: Major
                                Found in ghost/core/core/server/lib/image/ImageSize.js - About 30 mins to fix

                                  Avoid too many return statements within this function.
                                  Open

                                              return this.utils.createUrl('/404/', false);
                                  Severity: Major
                                  Found in ghost/core/core/server/services/url/UrlService.js - About 30 mins to fix

                                    Avoid too many return statements within this function.
                                    Open

                                        return null;
                                    Severity: Major
                                    Found in ghost/core/core/frontend/meta/schema.js - About 30 mins to fix

                                      Avoid too many return statements within this function.
                                      Open

                                          return [imgBlogUrl, urlUtils.STATIC_IMAGE_URL_PREFIX, `/size/${sizeDirectoryName}`, formatPrefix, imageName].join('');
                                      Severity: Major
                                      Found in ghost/core/core/frontend/utils/images.js - About 30 mins to fix

                                        Avoid too many return statements within this function.
                                        Open

                                                    return renderer.renderEntry(req, res)(post);
                                        Severity: Major
                                        Found in ghost/core/core/frontend/services/routing/controllers/email-post.js - About 30 mins to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language