getlackey/lackey-cms

View on GitHub

Showing 527 of 527 total issues

Similar blocks of code found in 2 locations. Consider refactoring.
Open

module.exports.decode = function (value, salt) {
    let decipher = crypto.createDecipher(algorithm, salt);
    return decipher.update(value, 'hex', 'utf8') + decipher.final('utf8');
};
Severity: Major
Found in modules/analytics/server/lib/dust/filter.js and 1 other location - About 1 hr to fix
modules/analytics/server/lib/dust/filter.js on lines 53..57

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 63.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function removeIdentity has 34 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            removeIdentity: (req, res) => {
                req.admin.getIdentities('email')
                    .then((identities) => {
                        let confCount = 0,
                            confirmed = false;
Severity: Minor
Found in modules/users/server/controllers/account.js - About 1 hr to fix

    Function list has 34 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        dust.helpers.list = function (chunk, context, bodies, params) {
            SCli.debug('lackey-cms/modules/cms/server/lib/dust/block');
    
            return chunk.map((injectedChunk) => {
    
    
    Severity: Minor
    Found in modules/cms/server/lib/dust/list.js - About 1 hr to fix

      Function tweet has 34 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        dust.helpers.tweet = function (chunk, context, bodies, params) {
      
          let
            data = context,
            account = params.account + '',
      Severity: Minor
      Found in modules/cms/server/lib/dust/tweet.js - About 1 hr to fix

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

        module.exports = function (server) {
            server.crud = function (path, name, middleware, endpoints) {
                var
                    param = name + '_id',
                    singlePath = path + '/:' + param,
        Severity: Minor
        Found in lib/server/init/crud.js - About 1 hr to fix

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

          module.exports = (data) => {
          
              let path, wrapped, templateObj;
          
              return require('./index')
          Severity: Minor
          Found in modules/core/server/models/template/generator.js - About 1 hr to fix

            Function _preSave has 34 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                        _preSave() {
            
                            let self = this,
                                promise = super._preSave();
            
            
            Severity: Minor
            Found in modules/core/server/models/content/index.js - About 1 hr to fix

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

              module.exports = (data) => {
                  return require('./index')
                      .then((media) => {
                          Media = media;
                          return Media.mapSource(data);
              Severity: Minor
              Found in modules/core/server/models/media/generator.js - About 1 hr to fix

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

                module.exports = (config, middlewares) => {
                
                    SCli.debug('lackey-cms/server/express', 'Setting up express');
                
                    // Initialize express app
                Severity: Minor
                Found in lib/server/express.js - About 1 hr to fix

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                              } else {
                                  if (!fieldB) {
                                      return -1;
                                  }
                                  if (!fieldA) {
                  Severity: Major
                  Found in modules/core/client/js/table.js and 1 other location - About 1 hr to fix
                  modules/core/client/js/table.js on lines 547..561

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 62.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Similar blocks of code found in 2 locations. Consider refactoring.
                  Open

                              if (direction === 'desc') {
                                  if (!fieldA) {
                                      return -1;
                                  }
                                  if (!fieldB) {
                  Severity: Major
                  Found in modules/core/client/js/table.js and 1 other location - About 1 hr to fix
                  modules/core/client/js/table.js on lines 561..575

                  Duplicated Code

                  Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                  Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                  When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                  Tuning

                  This issue has a mass of 62.

                  We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                  The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                  If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                  See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                  Refactorings

                  Further Reading

                  Function drawSections has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      drawSections() {
                          let
                              context,
                              self = this;
                  
                  
                  Severity: Minor
                  Found in modules/cms/client/js/manager/structure.ui.js - About 1 hr to fix

                    Function drawTaxonomy has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        drawTaxonomy() {
                    
                    
                            if (!this.options.media) return;
                    
                    
                    Severity: Minor
                    Found in modules/cms/client/js/manager/gallery.ui.js - About 1 hr to fix

                      Function bindMetaEvents has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          bindMetaEvents(responses) {
                              let settings = responses[0],
                                  context = responses[2];
                              let self = this;
                              lackey
                      Severity: Minor
                      Found in modules/cms/client/js/manager/structure.ui.js - About 1 hr to fix

                        Function _postSave has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                    _postSave(cached) {
                                        let
                                            self = this,
                                            parent = this.constructor;
                        
                        
                        Severity: Minor
                        Found in modules/core/server/models/taggable/index.js - About 1 hr to fix

                          Function moduleInterface has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          exports.moduleInterface = function (modulePath, moduleName) {
                          
                              let api = {
                                  /**
                                   * Loads module model
                          Severity: Minor
                          Found in lib/utils/index.js - About 1 hr to fix

                            Function _connectPostgres has 33 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                _connectPostgres(connectionName, config, drop) {
                                    let self = this;
                                    return new Promise((resolve, reject) => {
                                            let client = knex({
                                                client: 'pg',
                            Severity: Minor
                            Found in lib/datasources/index.js - About 1 hr to fix

                              Identical blocks of code found in 2 locations. Consider refactoring.
                              Open

                                              lackey.bind('[data-lky-hook=table-paging]', 'click', (event, hook) => {
                                                  event.preventDefault();
                                                  var thisPage = hook.dataset.page;
                                                  self.query(thisPage);
                                              }, nodes[0]);
                              Severity: Major
                              Found in modules/cms/client/js/manager/taxonomy.picker.ui.js and 1 other location - About 1 hr to fix
                              modules/cms/client/js/manager/gallery.ui.js on lines 384..388

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 61.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Identical blocks of code found in 2 locations. Consider refactoring.
                              Open

                                              lackey.bind('[data-lky-hook=table-paging]', 'click', (event, hook) => {
                                                  event.preventDefault();
                                                  var thisPage = hook.dataset.page;
                                                  self.query(thisPage);
                                              }, nodes[0]);
                              Severity: Major
                              Found in modules/cms/client/js/manager/gallery.ui.js and 1 other location - About 1 hr to fix
                              modules/cms/client/js/manager/taxonomy.picker.ui.js on lines 86..90

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 61.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Identical blocks of code found in 2 locations. Consider refactoring.
                              Open

                                                      items: value.items.map((item) => {
                                                          if (typeof item === 'string') {
                                                              return {
                                                                  label: item,
                                                                  value: item
                              Severity: Major
                              Found in modules/cms/client/js/manager/structure.ui.js and 1 other location - About 1 hr to fix
                              modules/cms/client/js/manager/structure.ui.js on lines 872..881

                              Duplicated Code

                              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                              Tuning

                              This issue has a mass of 61.

                              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                              Refactorings

                              Further Reading

                              Severity
                              Category
                              Status
                              Source
                              Language