getlackey/lackey-cms

View on GitHub

Showing 527 of 527 total issues

Function oAuthHandleNotLoggedIn has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

            static oAuthHandleNotLoggedIn(provider, id, accessToken, refreshToken, providerData, userData) {

                SCli.debug(__MODULE_NAME, 'oAuthHandleNotLoggedIn');

                let self = this;
Severity: Minor
Found in modules/core/server/models/user/index.js - About 1 hr to fix

    Function ajax has 27 lines of code (exceeds 25 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 1 hr to fix

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

                  _preSave(options) {
      
                      if (this.preventSave) {
                          throw new Error('Save prevention');
                      }
      Severity: Minor
      Found in modules/core/server/models/user/index.js - About 1 hr to fix

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

        module.exports = (server, config) => {
        
            SCli.debug('lackey-cms/server/init/envvars', 'Setting up');
        
            server.use((req, res, next) => {
        Severity: Minor
        Found in lib/server/init/envvars.js - About 1 hr to fix

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

                              return api
                                  .create('/cms/user/' + userId + '/role/' + JSON.parse(response).name, {})
                                  .then(() => {
                                      growl({
                                          status: 'success',
          Severity: Major
          Found in modules/cms/client/js/profile.js and 1 other location - About 1 hr to fix
          modules/cms/client/js/profile.js on lines 88..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 56.

          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

                  return api
                      .delete('/cms/user/' + userId + '/role/' + name)
                      .then(() => {
                          growl({
                              status: 'success',
          Severity: Major
          Found in modules/cms/client/js/profile.js and 1 other location - About 1 hr to fix
          modules/cms/client/js/profile.js on lines 47..60

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

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

          module.exports.walk = function walk(schema) {
              if (typeof schema !== 'object') return schema;
              if (schema.type === 'paragraph' && schema.content) {
                  let hasYOUTUBE = false;
                  schema.content.forEach((node) => {
          Severity: Minor
          Found in modules/cms/shared/treeparser.js - About 1 hr to fix

            Function exports has 26 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: Minor
            Found in modules/cms/server/controllers/language.js - About 1 hr to fix

              Function hasContent has 26 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                dust.helpers.hasContent = function (chunk, context, bodies, params) {
                  let
                    content = params.content,
                    field = params.field || false,
                    layout = content.layout,
              Severity: Minor
              Found in modules/cms/server/lib/dust/has-content.js - About 1 hr to fix

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

                module.exports = function () {
                    lackey
                        .hook('header.user')
                        .addEventListener('click', function () {
                            var nav = this.querySelector('nav');
                Severity: Minor
                Found in modules/cms/client/js/manager/user.dropdown.js - About 1 hr to fix

                  Function forgot has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              forgot: (req, res) => {
                                  let userId;
                                  if (!req.body.username.length) { //TODO improve
                                      throw(new Error('Email not found'));
                                  }
                  Severity: Minor
                  Found in modules/users/server/controllers/account.js - About 1 hr to fix

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

                        .then((ObjectionWrapper) => {
                            SCli.debug(__MODULE_NAME, 'READY');
                    
                            class PreviewModel extends Model {
                                static get tableName() {
                    Severity: Minor
                    Found in modules/core/server/models/preview/index.js - About 1 hr to fix

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

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

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

                        function youtube_parser(url) {
                          var match = url.match(yt_regex);
                          return match && match[7].length === 11 ? match[7] : url;
                        }
                        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 6..9

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

                        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

                                        User.findById(req.forgotPasswordUid)
                                            .then((usr) => {
                                                user = usr;
                                                return user.invalidatePasswordToken(req.forgotPasswordToken, 'password');
                                            })
                        Severity: Major
                        Found in modules/users/server/controllers/account.js and 1 other location - About 1 hr to fix
                        modules/users/server/controllers/account.js on lines 130..142

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

                        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

                        function youtube_parser(url) {
                            var match = url.match(yt_regex);
                            return match && match[7].length === 11 ? match[7] : url;
                        }
                        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 16..19

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

                        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

                                                    rows: data.rows.map(row => row.columns.map(column => column.value !== undefined ? column.value : ''))
                        Severity: Major
                        Found in modules/core/server/controllers/crud.injection.js and 1 other location - About 1 hr to fix
                        modules/analytics/server/controllers/dashboard.js on lines 58..58

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

                        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

                                                    rows: table.rows.map(row => row.columns.map(column => column.value !== undefined ? column.value : ''))
                        Severity: Major
                        Found in modules/analytics/server/controllers/dashboard.js and 1 other location - About 1 hr to fix
                        modules/core/server/controllers/crud.injection.js on lines 340..340

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

                        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

                                str += (Array.isArray(object) ? object : Object.keys(object).map(key => key === 'type' ? '' : object[key]))
                                    .map(item => getPlainText(item))
                        Severity: Minor
                        Found in modules/core/server/models/content/upgrade.js and 1 other location - About 55 mins to fix
                        modules/core/server/models/content/index.js on lines 280..281

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

                        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 (!top.Lackey || !top.LackeyManager) {
                                    debug('init - wait');
                                    setTimeout(() => {
                                        BlockEditor.init();
                                    }, 250);
                        Severity: Minor
                        Found in modules/cms/client/js/block-editor.js and 1 other location - About 55 mins to fix
                        modules/cms/client/js/wysiwyg.js on lines 367..373

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

                        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