getlackey/lackey-cms

View on GitHub

Showing 527 of 527 total issues

Function video_embed has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function video_embed(md, options) {
    function video_return(state, silent) {
        var serviceEnd,
            serviceStart,
            token,
Severity: Minor
Found in modules/cms/shared/video/editmode.js - About 1 hr to fix

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

    module.exports = (dust) => {
    
      dust.helpers.taxonomy = function (chunk, context, bodies, params) {
        let data = context.get('data'),
          name = params.name,
    Severity: Minor
    Found in modules/cms/server/lib/dust/taxonomy.js - About 1 hr to fix

      Function _populate has 46 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

                  _populate() {
      
                      let self = this;
      
                      return super
      Severity: Minor
      Found in modules/core/server/models/template/index.js - About 1 hr to fix

        Function captureRequest has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            captureRequest: (req, res, next) => {
        
                try {
        
                    // hack. Saving a reference to the end function to
        Severity: Minor
        Found in modules/core/server/controllers/activitylog.js - About 1 hr to fix

          Function iframe has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

                      iframe: (req, res) => {
                          try {
                              let iframePath, fullIframePath, variants;
          
                              iframePath = req.originalUrl.replace(/^\/admin/, '');
          Severity: Minor
          Found in modules/cms/server/controllers/index.js - About 1 hr to fix

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

                                try {
                                    data.createdAt = responses[2].createdAt;
                                    data.createdAtFormatted = dateformat(new Date(responses[2].createdAt));
                                } catch (e) {
                                    console.error(e);
            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/structure.ui.js on lines 611..616

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

            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

                                try {
                                    data.publishAt = responses[2].publishAt;
                                    data.publishAtFormatted = dateformat(new Date(responses[2].publishAt));
                                } catch (e) {
                                    console.error(e);
            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/structure.ui.js on lines 605..610

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

            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

            function on(eventName, listener) {
                this.__listeners = this.__listeners || {};
                this.__listeners[eventName] = this.__listeners[eventName] || [];
                this.__listeners[eventName].push(listener);
            }
            Severity: Major
            Found in modules/cms/client/js/emit.js and 1 other location - About 1 hr to fix
            modules/core/server/controllers/crud.injection.js on lines 115..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 71.

            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

                static overrideGetter(field, handler) {
                    this.__overrides = this.__overrides || {};
                    this.__overrides[field] = this.__overrides[field] || [];
                    this.__overrides[field].push(handler);
                }
            Severity: Major
            Found in modules/core/server/controllers/crud.injection.js and 1 other location - About 1 hr to fix
            modules/cms/client/js/emit.js on lines 25..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 71.

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

            module.exports = (server) => {
            
                return SUtils
                    .waitForAs('login routes',
                        require('../controllers/account')
            Severity: Minor
            Found in modules/users/server/routes/login.routes.js - About 1 hr to fix

              Function redraw has 44 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  redraw(options) {
              
                      let self = this;
              
                      return template
              Severity: Minor
              Found in modules/cms/client/js/manager/datetime.picker.ui.js - About 1 hr to fix

                Function taxonomy has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  dust.helpers.taxonomy = function (chunk, context, bodies, params) {
                    let data = context.get('data'),
                      name = params.name,
                      type = params.type,
                      many = !!params.many,
                Severity: Minor
                Found in modules/cms/server/lib/dust/taxonomy.js - About 1 hr to fix

                  Function run has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                              run(user, page, limit, order) {
                  
                                  let self = this,
                                      num_limit = limit || 10,
                                      orders = [];
                  Severity: Minor
                  Found in modules/core/server/models/content/querybuilder.js - About 1 hr to fix

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

                        .then(FlyWeight => {
                    
                            SCli.debug(__MODULE_NAME, 'READY');
                    
                            class TaxonomyTypeModel extends Model {
                    Severity: Minor
                    Found in modules/core/server/models/taxonomy-type/index.js - About 1 hr to fix

                      Function set has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                            set(media) {
                      
                                  let original = this.original,
                                        position = original ? original.getBoundingClientRect() : {},
                                        paddingTop = this.paddingTop,
                      Severity: Minor
                      Found in modules/cms/client/js/manager/dummy.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 exports has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                      module.exports = (dust) => {
                      
                          dust.helpers.error = function (chunk, context, bodies, params) {
                              try {
                                  if ((context.get && context.get('edit')) || context.edit) {
                      Severity: Minor
                      Found in modules/cms/server/lib/dust/error.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 video_embed has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                      Open

                      function video_embed(md, options) {
                          function video_return(state, silent) {
                              var serviceEnd,
                                  serviceStart,
                                  token,
                      Severity: Minor
                      Found in modules/cms/shared/video/editmode.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

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

                              User.findById(req.params.passwordUid)
                                  .then((usr) => {
                                      user = usr;
                                      return user.validateToken(req.params.passwordToken, 'password');
                                  })
                      Severity: Major
                      Found in modules/cms/server/controllers/user.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 70.

                      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.validateToken(req.forgotPasswordToken, 'password');
                                          })
                      Severity: Major
                      Found in modules/users/server/controllers/account.js and 1 other location - About 1 hr to fix
                      modules/cms/server/controllers/user.js on lines 279..291

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

                      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

                      Repository.prototype.resetAll = function () {
                          let self = this;
                          return Promise.all(Object.keys(this._copy).map((key) => self.reset(key)));
                      };
                      Severity: Major
                      Found in modules/cms/client/js/manager/repository.js and 1 other location - About 1 hr to fix
                      modules/cms/client/js/manager/repository.js on lines 194..197

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

                      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