getlackey/lackey-cms

View on GitHub

Showing 324 of 527 total issues

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

module.exports = (dust) => {

    function renderParameter(name, chunk, context, bodies, params) {
        if (params && params[name]) {
            if (typeof params[name] === 'function') {
Severity: Minor
Found in modules/core/shared/dust/path.js - About 7 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

Function format has 192 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports.format = (req, res, next) => {
    var isYAML = (/(.*).yaml/).test(req.path),
        isJSON = !isYAML && ((/(.*).json$/).test(req.path) || (/^\/api\//).test(req.path)),
        isXLS = !isJSON && !isYAML && (/(.*).xlsx/).test(req.path),
        isHTML = !isJSON && !isYAML && !isXLS;
Severity: Major
Found in lib/server/init/format.js - About 7 hrs to fix

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

    module.exports = function (connect) {
    
        /**
         * Connect's Store.
         */
    Severity: Major
    Found in modules/users/server/lib/connect-session-knex/index.js - About 7 hrs to fix

      Function table has 187 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                          static table(inputQuery, inputColumns, options) {
                              SCli.debug(__MODULE_NAME, 'table', this.model.tableName, JSON.stringify(inputQuery), JSON.stringify(inputColumns), JSON.stringify(options));
                              let
                                  query,
                                  columns = inputColumns,
      Severity: Major
      Found in modules/core/server/models/objection/index.js - About 7 hrs to fix

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

            .then((FlyWeight, TaxonomyType) => {
        
                SCli.debug(__MODULE_NAME, 'READY');
        
                class TaxonomyModel extends Model {
        Severity: Major
        Found in modules/core/server/models/taxonomy/index.js - About 7 hrs to fix

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

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

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

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

              File block-editor.js has 443 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

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

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

                module.exports = (gulp, projectDIR) => {
                
                    let lackeyDIR = path.resolve(__dirname + '/..'),
                        htDocs = projectDIR + '/htdocs';
                
                
                Severity: Major
                Found in gulp/index.js - About 6 hrs to fix

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

                  module.exports = () => new Promise((resolve, reject) => {
                          atomus()
                              .html('<html></html>')
                              .ready(function (errors, window) {
                                  try {
                  Severity: Major
                  Found in modules/core/server/models/content/upgrade.js - About 6 hrs to fix

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

                    module.exports = () => new Promise((resolve, reject) => {
                            atomus()
                                .html('<html></html>')
                                .ready(function (errors, window) {
                                    try {
                    Severity: Minor
                    Found in modules/core/server/models/content/upgrade.js - About 6 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

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

                    module.exports = dust => {
                    
                      /**
                       * Editable DUSTJS helper
                       * @param   {Chunk} chunk
                    Severity: Minor
                    Found in modules/cms/server/lib/dust/editable.js - About 6 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

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

                        .then((Taggable) => {
                    
                            SCli.debug(__MODULE_NAME, 'READY');
                    
                            require('./generator');
                    Severity: Major
                    Found in modules/core/server/models/role/index.js - About 5 hrs to fix

                      Function render has 140 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                          render() {
                      
                              debug('render');
                      
                              let
                      Severity: Major
                      Found in modules/cms/client/js/wysiwyg.js - About 5 hrs to fix

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

                        /* eslint no-underscore-dangle:0 */
                        /* jslint node:true, esnext:true */
                        /* globals LACKEY_PATH */
                        'use strict';
                        
                        
                        Severity: Minor
                        Found in modules/core/server/models/content/index.js - About 5 hrs to fix

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

                          module.exports = function (connect) {
                          
                              /**
                               * Connect's Store.
                               */
                          Severity: Minor
                          Found in modules/users/server/lib/connect-session-knex/index.js - About 5 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

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

                              .then((Taggable, QueryBuilder) => {
                          
                                  SCli.debug(__MODULE_NAME, 'READY');
                          
                                  class MediaModel extends Model {
                          Severity: Minor
                          Found in modules/core/server/models/media/index.js - About 5 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

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

                              .then((Role, User, TaxonomyType, Taxonomy, Template, Media, Content) => {
                          
                                  class Serializer {
                                      static all() {
                                          let result = {};
                          Severity: Major
                          Found in modules/cms/server/lib/serializer.js - About 5 hrs to fix

                            Function ajax has a Cognitive Complexity of 34 (exceeds 5 allowed). Consider refactoring.
                            Open

                                    ajax: function (path, method, data, raw) {
                            
                                        return new Promise(function (resolve, reject) {
                            
                                            var xhr = new XMLHttpRequest(),
                            Severity: Minor
                            Found in modules/core/client/js/es5/xhr.js - About 5 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 page.js has 378 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/cms/server/controllers/page.js - About 5 hrs to fix
                              Severity
                              Category
                              Status
                              Source
                              Language