getlackey/lackey-cms

View on GitHub

Showing 527 of 527 total issues

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

    static generateAbstractBlock(block, parentBounds) {
        var container = top.document.createElement('figure'),
            bounds = block.getAbsoluteBoundingRect(),
            promise = Promise.resolve();
        container.setAttribute('class', 'block');
Severity: Minor
Found in modules/cms/client/js/block-editor.js - About 1 hr to fix

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

    module.exports.viewAs = (req, res, next) => {
    
        return SUtils
            .cmsMod('core')
            .model('role')
    Severity: Minor
    Found in modules/users/index.js - About 1 hr to fix

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

                  res.end = function (chunk, encoding) {
      
                      let sent = false;
      
                      try {
      Severity: Minor
      Found in modules/core/server/controllers/activitylog.js - About 1 hr to fix

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

                    static byTypeAndParam(type, paramName, paramValue) {
        
                        let self = this;
        
                        return this
        Severity: Minor
        Found in modules/core/server/models/taxonomy/index.js - About 1 hr to fix

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

          module.exports.translate = (req, res, next) => {
          
              req.locale = module.exports.defaultLocale;
          
              let route = req.route || req.path,
          Severity: Minor
          Found in lib/server/init/locale.js - About 1 hr to fix

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

                _initModules() {
            
                    SCli.log(__MODULE_NAME, '5. Initing modules');
                    let _this = this,
                        current = Promise.resolve();
            Severity: Minor
            Found in lib/server/index.js - About 1 hr to fix

              Function replace has 30 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                    replace(newTag) {
                          let self = this;
                          Object.keys(this.attributes)
                                .forEach(attr => {
                                      newTag.setAttribute(attr, self.attributes[attr]);
              Severity: Minor
              Found in modules/cms/client/js/media.js - About 1 hr to fix

                Function getOptions has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    getOptions() {
                        let options = this.options,
                            v = this._viewing,
                            firstOfMonth = new Date(Date.UTC(v.getUTCFullYear(), v.getUTCMonth(), 1, options.current.getUTCHours(), options.current.getUTCMinutes(), 0, 0)),
                            dow = firstOfMonth.getUTCDay() - 1,
                Severity: Minor
                Found in modules/cms/client/js/manager/datetime.picker.ui.js - About 1 hr to fix

                  Function query has 30 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                                      static query(query, populate, options) {
                                          let self = this;
                                          SCli.debug(__MODULE_NAME, 'query', this.model.tableName);
                                          if (!self.model) {
                                              return Promise.reject('This model doesn\'t supply mongo model reference for shared methods');
                  Severity: Minor
                  Found in modules/core/server/models/objection/index.js - About 1 hr to fix

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

                    module.exports = (options) => {
                        return require('../configuration')()
                            .then((config) => {
                                if (!transport) {
                                    SCli.debug(__MODULE_NAME, 'createTransport', config.get('mailer.type'));
                    Severity: Minor
                    Found in lib/mailer/index.js - About 1 hr to fix

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

                      module.exports = (app) => {
                      
                          SCli.debug('lackey-cms/server/basics', 'Setting up');
                      
                          // Showing stack errors
                      Severity: Minor
                      Found in lib/server/init/basics.js - About 1 hr to fix

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

                                if (serviceLower === 'youtube') {
                                    videoID = youtube_parser(videoID);
                                } else if (serviceLower === 'vimeo') {
                                    videoID = vimeo_parser(videoID);
                                } else if (serviceLower === 'htmlvideo') {
                        Severity: Major
                        Found in modules/cms/shared/video/editmode.js and 1 other location - About 1 hr to fix
                        modules/cms/shared/video/viewmode.js on lines 78..86

                        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 59.

                        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

                            } else if (serviceLower === 'vine') {
                              videoID = vine_parser(videoID);
                            } else if (serviceLower === 'prezi') {
                              videoID = prezi_parser(videoID);
                            } else if (serviceLower === 'htmlvideo') {
                        Severity: Major
                        Found in modules/cms/shared/video/viewmode.js and 1 other location - About 1 hr to fix
                        modules/cms/shared/video/editmode.js on lines 43..51

                        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 59.

                        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 sendConfirmationEmail has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                    sendConfirmationEmail: (req, res) => {
                                        let lib, config;
                                        SCli.debug(__MODULE_NAME, 'Respond');
                                        configuration()
                                            .then((cfg) => {
                        Severity: Minor
                        Found in modules/users/server/controllers/account.js - About 1 hr to fix

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

                          module.exports = (dust) => {
                          
                              function renderBlock(block, chunk, context) {
                                  var output = '';
                                  chunk.tap(function (data) {
                          Severity: Minor
                          Found in modules/cms/server/lib/dust/translate.js - About 1 hr to fix

                            Function moveBlock has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                                moveBlock(blockElement, beforeBlockElement) {
                                    let self = this,
                                        parentPath = blockElement.getAttribute('data-lky-parent'),
                                        blockIndex = parseInt(blockElement.getAttribute('data-lky-index')),
                                        blockPath = parentPath + '.' + blockIndex,
                            Severity: Minor
                            Found in modules/cms/client/js/manager/structure.ui.js - About 1 hr to fix

                              Function KnexStore has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                                  function KnexStore(opts) {
                                      var self = this,
                                          options = opts || {};
                              
                                      Store.call(self, options);
                              Severity: Minor
                              Found in modules/users/server/lib/connect-session-knex/index.js - About 1 hr to fix

                                Function _preQuery has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                            static _preQuery(innerQuery, options) {
                                
                                                let query = innerQuery ? JSON.parse(JSON.stringify(innerQuery)) : {},
                                                    opts = options ? options : {};
                                
                                
                                Severity: Minor
                                Found in modules/core/server/models/user/index.js - About 1 hr to fix

                                  Function open has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                      static open(name, vars, controller) {
                                          return template.render(name, vars, {
                                                  returnRoot: true
                                              })
                                              .then((root) => {
                                  Severity: Minor
                                  Found in modules/core/client/js/modal.js - About 1 hr to fix

                                    Function input has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                                    Open

                                    Upload.prototype.input = function (HTMLElement, onClick) {
                                    
                                        this._hover = this.hover.bind(this);
                                        this._drop = this.drop.bind(this);
                                        this._pick = this.pick.bind(this);
                                    Severity: Minor
                                    Found in modules/core/client/js/upload.js - About 1 hr to fix
                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language