TryGhost/Ghost

View on GitHub

Showing 1,820 of 4,015 total issues

Function setFacebookUrl has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    @action
    setFacebookUrl(event) {
        const {model, modelProperty} = this.args;

        let newUrl = event.target.value;
Severity: Minor
Found in ghost/admin/app/components/gh-facebook-url-input.js - About 1 hr to fix

    Function default has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function () {
        let path = window.location.pathname;
        let subdir = path.substr(0, path.search('/ghost/'));
        let adminRoot = `${subdir}/ghost/`;
        let assetRoot = `${subdir}/ghost/assets/`;
    Severity: Minor
    Found in ghost/admin/app/utils/ghost-paths.js - About 1 hr to fix

      Function mockSettings has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function mockSettings(server) {
          server.get('/settings/', function ({db}, {queryParams}) {
              let {group} = queryParams;
              let filters = group.split(',');
              let settings = [];
      Severity: Minor
      Found in ghost/admin/mirage/config/settings.js - About 1 hr to fix

        Function constructor has 31 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            constructor(options) {
                const {
                    cookieSecure = true,
                    cookieName = 'members-ssr',
                    cookieMaxAge = SIX_MONTHS_MS,
        Severity: Minor
        Found in ghost/members-ssr/lib/members-ssr.js - About 1 hr to fix

          Function getSerializedData has 31 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              getSerializedData({member, tier = null, subscription = null, offer = null}) {
                  return {
                      offer: offer ? {
                          name: offer.name,
                          type: offer.discount_type,
          Severity: Minor
          Found in ghost/staff-service/lib/StaffService.js - About 1 hr to fix

            Function output has 31 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports.output = (response = {}, apiConfig, apiSerializers, frame) => {
                debug('output');
            
                const tasks = [];
            
            
            Severity: Minor
            Found in ghost/api-framework/lib/serializers/handle.js - About 1 hr to fix

              Function getForPost has 31 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  async getForPost(postId) {
                      const knex = this.knex;
                      const signupRows = await knex('members_created_events')
                          .select('referrer_source')
                          .select(knex.raw('COUNT(id) AS total'))
              Severity: Minor
              Found in ghost/stats-service/lib/ReferrersStatsService.js - About 1 hr to fix

                Function _startVerificationProcess has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    async _startVerificationProcess({
                        amount,
                        throwOnTrigger,
                        source
                    }) {
                Severity: Minor
                Found in ghost/verification-trigger/lib/VerificationTrigger.js - About 1 hr to fix

                  Function loadConverters has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const loadConverters = () => {
                      if (excerptConverter && emailConverter) {
                          return;
                      }
                  
                  
                  Severity: Minor
                  Found in ghost/html-to-plaintext/lib/html-to-plaintext.js - About 1 hr to fix

                    Function serve has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        serve() {
                            const {storagePath, errorMessages} = this;
                    
                            return function serveStaticContent(req, res, next) {
                                return serveStatic(
                    Severity: Minor
                    Found in ghost/core/core/server/adapters/storage/LocalStorageBase.js - About 1 hr to fix

                      Function countRelations has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          countRelations() {
                              return {
                                  replies(modelOrCollection) {
                                      modelOrCollection.query('columns', 'comments.*', (qb) => {
                                          qb.count('replies.id')
                      Severity: Minor
                      Found in ghost/core/core/server/models/comment.js - About 1 hr to fix

                        Function init has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                            init() {
                                if (this.eventStorage) {
                                    // Prevent creating duplicate DomainEvents subscribers
                                    return;
                                }
                        Severity: Minor
                        Found in ghost/core/core/server/services/members-events/index.js - About 1 hr to fix

                          Function getResource has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                              getResource(url, options) {
                                  options = options || {};
                          
                                  let objects = this.urls.getByUrl(url);
                          
                          
                          Severity: Minor
                          Found in ghost/core/core/server/services/url/UrlService.js - About 1 hr to fix

                            Function _onResourceAdded has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                async _onResourceAdded(type, model) {
                                    debug('_onResourceAdded', type);
                            
                                    const resourceConfig = _.find(this.resourcesConfig, {type: type});
                            
                            
                            Severity: Minor
                            Found in ghost/core/core/server/services/url/Resources.js - About 1 hr to fix

                              Function _prepareModelSync has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  _prepareModelSync(model, resourceConfig) {
                                      const exclude = resourceConfig.modelOptions.exclude;
                                      const withRelatedFields = resourceConfig.modelOptions.withRelatedFields;
                                      const obj = _.omit(model.toJSON(), exclude);
                              
                              
                              Severity: Minor
                              Found in ghost/core/core/server/services/url/Resources.js - About 1 hr to fix

                                Function browse has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    browse({user}) {
                                        let allNotifications = this.fetchAllNotifications();
                                        allNotifications = _.orderBy(allNotifications, 'addedAt', 'desc');
                                        const blogVersion = ghostVersion.full.match(/^(\d+\.)(\d+\.)(\d+)/);
                                
                                
                                Severity: Minor
                                Found in ghost/core/core/server/services/notifications/Notifications.js - About 1 hr to fix

                                  Function up has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      async function up(knex) {
                                          logging.info('Populating members_subscribe_events from members');
                                  
                                          const allMembers = await knex.select(
                                              'id as member_id',

                                    Function exports has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    module.exports = function (...attrs) {
                                        // Options is the last argument
                                        const options = attrs.pop();
                                        let date;
                                    
                                    
                                    Severity: Minor
                                    Found in ghost/core/core/frontend/helpers/date.js - About 1 hr to fix

                                      Function makeAPICall has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                      Open

                                      async function makeAPICall(resource, controllerName, action, apiOptions) {
                                          const controller = api[controllerName];
                                      
                                          let timer;
                                      
                                      
                                      Severity: Minor
                                      Found in ghost/core/core/frontend/helpers/collection.js - About 1 hr to fix

                                        Function configure has 31 lines of code (exceeds 25 allowed). Consider refactoring.
                                        Open

                                        function configure(dbConfig) {
                                            const client = dbConfig.client;
                                        
                                            if (client === 'sqlite3') {
                                                // Backwards compatibility with old knex behaviour
                                        Severity: Minor
                                        Found in ghost/core/core/server/data/db/connection.js - About 1 hr to fix
                                          Severity
                                          Category
                                          Status
                                          Source
                                          Language