getlackey/lackey-cms

View on GitHub

Showing 324 of 527 total issues

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

    .then((knex) => {

        class ContentQueryBuilder {

            constructor() {
Severity: Major
Found in modules/core/server/models/content/querybuilder.js - About 5 hrs to fix

    Function lookup has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring.
    Open

    module.exports.lookup = (lackeyPath, projectPath) => {
    
        let fn = (_path, options, callback) => {
    
            if (typeof _path === 'string' && _path.indexOf(',') >= 0) {
    Severity: Minor
    Found in lib/server/init/views.js - About 4 hrs to fix

    Cognitive Complexity

    Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

    A method's cognitive complexity is based on a few simple rules:

    • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
    • Code is considered more complex for each "break in the linear flow of the code"
    • Code is considered more complex when "flow breaking structures are nested"

    Further reading

    StructureUI has 37 functions (exceeds 20 allowed). Consider refactoring.
    Open

    class StructureUI extends Emitter {
    
        /**
         * Gets template meta data
         * @param   {string} templatePath
    Severity: Minor
    Found in modules/cms/client/js/manager/structure.ui.js - About 4 hrs to fix

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

      module.exports = (dust, config) => {
      
        dust.filters.media = function (value) {
          var returnString = '';
          if (value.mime === 'video/youtube') {
      Severity: Major
      Found in modules/cms/server/lib/dust/media.js - About 4 hrs to fix

        Function print has 117 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                    static print(page, fullPath, res, req, preview) {
        
                        let
                            path,
                            user = req.user,
        Severity: Major
        Found in modules/cms/server/controllers/page.js - About 4 hrs to fix

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

              .then((ObjectionWrapper, Taxonomy) => {
          
                  SCli.debug(__MODULE_NAME, 'READY');
          
                  /**
          Severity: Major
          Found in modules/core/server/models/taggable/index.js - About 4 hrs to fix

            Function exports has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
            Open

            module.exports = (dust, config) => {
            
              dust.filters.media = function (value) {
                var returnString = '';
                if (value.mime === 'video/youtube') {
            Severity: Minor
            Found in modules/cms/server/lib/dust/media.js - About 4 hrs to fix

            Cognitive Complexity

            Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

            A method's cognitive complexity is based on a few simple rules:

            • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
            • Code is considered more complex for each "break in the linear flow of the code"
            • Code is considered more complex when "flow breaking structures are nested"

            Further reading

            File index.js has 357 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            /* jslint esnext:true, node:true */
            /* globals LACKEY_PATH */
            'use strict';
            
            /*
            Severity: Minor
            Found in modules/core/server/models/media/index.js - About 4 hrs to fix

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

              module.exports = (socket, config) => {
              
              
                  socket.on('media.start-upload', (data) => {
                      console.log('media.start-upload', data);
              Severity: Major
              Found in modules/core/server/models/media/sockets.js - About 4 hrs to fix

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

                    .then((ObjectionWrapper) => {
                        SCli.debug(__MODULE_NAME, 'READY');
                
                        class AnalyticsModel extends Model {
                            static get tableName() {
                Severity: Major
                Found in modules/core/server/models/analytics/index.js - About 4 hrs to fix

                  BlockEditor has 33 functions (exceeds 20 allowed). Consider refactoring.
                  Open

                  class BlockEditor {
                      constructor(path, template, block) {
                          debug('Constructor', block);
                  
                          var self = this;
                  Severity: Minor
                  Found in modules/cms/client/js/block-editor.js - About 4 hrs to fix

                    Function block has 103 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    module.exports.block = (config, injectedChunk, context, bodies, params, dust) => {
                    
                      SCli.debug('lackey-cms/modules/cms/server/lib/dust/block');
                    
                      if (!config) {
                    Severity: Major
                    Found in modules/cms/server/lib/dust/block.js - About 4 hrs to fix

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

                      module.exports = function (el, cb) {
                          var media,
                              dragdrop,
                              root = el || document,
                              callback = cb || function () {},
                      Severity: Major
                      Found in modules/cms/client/js/new-media.js - About 4 hrs to fix

                        File wysiwyg.js has 337 lines of code (exceeds 250 allowed). Consider refactoring.
                        Open

                        /* eslint no-cond-assign:0, no-new:0 */
                        /* jslint browser:true, node:true, esnext:true */
                        'use strict';
                        /*
                            Copyright 2016 Enigma Marketing Services Limited
                        Severity: Minor
                        Found in modules/cms/client/js/wysiwyg.js - About 4 hrs to fix

                          Function constructor has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
                          Open

                              constructor(element) {
                                  var
                                      self = this;
                                  this._search = lackey.select('[data-lky-hook="table.filter"]')[0];
                                  this._root = element;
                          Severity: Minor
                          Found in modules/core/client/js/table.js - About 4 hrs to fix

                          Cognitive Complexity

                          Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.

                          A method's cognitive complexity is based on a few simple rules:

                          • Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
                          • Code is considered more complex for each "break in the linear flow of the code"
                          • Code is considered more complex when "flow breaking structures are nested"

                          Further reading

                          File module-loader.js has 336 lines of code (exceeds 250 allowed). Consider refactoring.
                          Open

                          /* jslint node:true, esnext:true, no-use-before-define */
                          /* eslint no-use-before-define:0 */
                          /* globals LACKEY_PATH */
                          'use strict';
                          
                          
                          Severity: Minor
                          Found in lib/server/module-loader.js - About 4 hrs to fix

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

                                .then((Model, Crud) => {
                                    class Controller extends Crud {
                            
                                        static get model() {
                                            return this._overriden('model', Model);
                            Severity: Major
                            Found in modules/cms/server/controllers/media.js - About 4 hrs to fix

                              Function print has 100 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function print(chunk, data, type, editMode, dust, log, config) {
                                let source;
                              
                                SCli.debug('lackey-cms/modules/cms/server/lib/dust/media', 'Print', JSON.stringify(data, null, 4));
                              
                              
                              Severity: Major
                              Found in modules/cms/server/lib/dust/media.js - About 4 hrs to fix

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

                                module.exports = function (el, cb) {
                                    var root = el || document,
                                        callback = cb || function () {};
                                
                                    lackey.bind('[data-lky-hook="action:pick-taxonomy"]', 'click', (event, hook) => {
                                Severity: Major
                                Found in modules/cms/client/js/profile.js - About 3 hrs to fix

                                  File crud.injection.js has 324 lines of code (exceeds 250 allowed). Consider refactoring.
                                  Open

                                  /* jslint esnext:true, node:true */
                                  /* globals LACKEY_PATH */
                                  'use strict';
                                  /*
                                      Copyright 2016 Enigma Marketing Services Limited
                                  Severity: Minor
                                  Found in modules/core/server/controllers/crud.injection.js - About 3 hrs to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language