getlackey/lackey-cms

View on GitHub

Showing 527 of 527 total issues

Function crawlBack has 40 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function crawlBack(data) {
            if (data) {
                if (data.type === 'doc') {
                    return Promise.resolve(toMarkdown(parseFrom(window.LackeySchema, data, 'json')).replace(/\s\s\r\n/g, ' \\n'));
                }
Severity: Minor
Found in modules/core/server/models/content/upgrade.js - About 1 hr to fix

    Function readModule has 40 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function readModule(name, server) {
    
        SCli.debug(__MODULE_NAME, 'READ ' + name);
    
        if (loadedModules[name]) {
    Severity: Minor
    Found in lib/server/module-loader.js - About 1 hr to fix

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

          fadeIn() {
              return new Promise(resolve => {
                  let self = this;
      
                  setTimeout(() => {
      Severity: Major
      Found in modules/cms/client/js/manager/picker.ui.js and 1 other location - About 1 hr to fix
      modules/cms/client/js/manager/structure.ui.js on lines 824..834

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

      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

          fadeIn() {
              return new Promise(resolve => {
                  let self = this;
      
                  setTimeout(() => {
      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/picker.ui.js on lines 109..119

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

      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

        create: function (path, data, readAs) {
          return xhr
            .basedPost('/api' + path, data)
            .then(function (response) {
              return parse(response, readAs);
      Severity: Major
      Found in modules/core/client/js/es5/api.js and 1 other location - About 1 hr to fix
      modules/core/client/js/es5/api.js on lines 64..72

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

      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

        update: function (path, data, readAs) {
          return xhr
            .basedPut('/api' + path, data)
            .then(function (response) {
              return parse(response, readAs);
      Severity: Major
      Found in modules/core/client/js/es5/api.js and 1 other location - About 1 hr to fix
      modules/core/client/js/es5/api.js on lines 55..63

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

      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 exports has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
      Open

          .then((Model, Crud) => {
              class RedirectCtrl extends Crud {
      
                  static get model() {
                      return this._overriden('model', Model);
      Severity: Minor
      Found in modules/cms/server/controllers/redirect.js - About 1 hr 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 block has a Cognitive Complexity of 13 (exceeds 5 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: Minor
      Found in modules/cms/server/lib/dust/block.js - About 1 hr 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 leaderboard has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  static leaderboard(pattern, regPattern, map) {
      
                      let regex = new RegExp(regPattern);
      
                      return this
      Severity: Minor
      Found in modules/core/server/models/analytics/index.js - About 1 hr to fix

        Function save has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

                            save(options) {
                                SCli.debug(__MODULE_NAME, 'save', this.constructor.model.tableName);
                                let self = this,
                                    hook = new Error(),
                                    cached = _.cloneDeep(this._doc);
        Severity: Minor
        Found in modules/core/server/models/objection/index.js - About 1 hr to fix

          Function _listen has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              _listen() {
                  SCli.log(__MODULE_NAME, '6. Listen');
          
                  let self = this;
          
          
          Severity: Minor
          Found in lib/server/index.js - About 1 hr to fix

            Function Manager has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function Manager() {
            
                let self = this,
                    overlay = lackey
                    .hook('settings.overlay');
            Severity: Minor
            Found in modules/cms/client/js/manager/index.js - About 1 hr to fix

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

              module.exports = (instance) => {
              
                  instance.addDustHelper(error);
                  instance.addDustHelper(editable);
                  instance.addDustHelper(image);
              Severity: Minor
              Found in modules/cms/index.js - About 1 hr to fix

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

                        } else {
                            this._lackeyGet = top.LackeyManager.get.bind(top.LackeyManager);
                            this._lackeySet = top.LackeyManager.set.bind(top.LackeyManager);
                        }
                Severity: Major
                Found in modules/cms/client/js/wysiwyg.js and 1 other location - About 1 hr to fix
                modules/cms/client/js/wysiwyg.js on lines 98..101

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

                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 (this.isProperty) {
                            this._lackeyGet = top.LackeyManager.getProperty.bind(top.LackeyManager);
                            this._lackeySet = top.LackeyManager.setProperty.bind(top.LackeyManager);
                        } else {
                Severity: Major
                Found in modules/cms/client/js/wysiwyg.js and 1 other location - About 1 hr to fix
                modules/cms/client/js/wysiwyg.js on lines 101..104

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

                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

                  delete: function (path, readAs) {
                    return xhr
                      .basedDelete('/api' + path)
                      .then(function (response) {
                        return parse(response, readAs);
                Severity: Major
                Found in modules/core/client/js/es5/api.js and 1 other location - About 1 hr to fix
                modules/core/client/js/es5/api.js on lines 46..54

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

                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

                  read: function (path, readAs) {
                    return xhr
                      .basedGet('/api' + path)
                      .then(function (response) {
                        return parse(response, readAs);
                Severity: Major
                Found in modules/core/client/js/es5/api.js and 1 other location - About 1 hr to fix
                modules/core/client/js/es5/api.js on lines 73..81

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

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

                            static populateContent(target, item, req, page) {
                                let includeTaxonomies,
                                    excludeTaxonomies;
                
                                return PageController
                Severity: Minor
                Found in modules/cms/server/controllers/page.js - About 1 hr to fix

                  Function progress has 37 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      function progress(file, guid) {
                  
                          SCli.debug(__MODULE_NAME, 'progress');
                  
                          let place = file.downloaded / 524288,
                  Severity: Minor
                  Found in modules/core/server/models/media/sockets.js - About 1 hr to fix

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

                        function renderBlock(block, chunk, context) {
                            var output = '';
                            chunk.tap(function (data) {
                                output += data;
                                return '';
                    Severity: Major
                    Found in modules/cms/server/lib/dust/translate.js and 2 other locations - About 1 hr to fix
                    modules/analytics/server/lib/dust/filter.js on lines 28..35
                    modules/cms/server/lib/dust/base.js on lines 22..29

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

                    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