getlackey/lackey-cms

View on GitHub

Showing 527 of 527 total issues

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

    .then((ObjectionWrapper) => {
        SCli.debug(__MODULE_NAME, 'READY');

        class TranslationModel extends Model {
            static get tableName() {
Severity: Major
Found in modules/core/server/models/translation/index.js - About 2 hrs to fix

    Function exports has 54 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/taxonomy.js - About 2 hrs to fix

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

            constructor(root, options) {
                  let self = this;
      
                  this.page = 1;
                  this.total = 0;
      Severity: Major
      Found in modules/cms/client/js/manager/media.js - About 2 hrs to fix

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

            basePath = (base ? base.getAttribute('href')
                .replace(/(.{1})\/$/, '$1') : (loc.protocol + '//' + loc.host + (loc.port && loc.port.length ? (':' + loc.port) : ''))) + '/',
        Severity: Major
        Found in modules/core/client/js/es5/xhr.js and 1 other location - About 2 hrs to fix
        modules/core/client/js/template.js on lines 40..41

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

        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 (basetag ? basetag.getAttribute('href')
                    .replace(/(.{1})\/$/, '$1') : (loc.protocol + '//' + loc.host + (loc.port && loc.port.length ? (':' + loc.port) : ''))) + '/';
        Severity: Major
        Found in modules/core/client/js/template.js and 1 other location - About 2 hrs to fix
        modules/core/client/js/es5/xhr.js on lines 24..25

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

        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 updateOverlay(block, bounds) {
                BlockEditor.updateOverlayBounds(bounds);
        
                if (BlockEditor.activeBlock !== block) {
                    BlockEditor.overlay.setAttribute('data-target-change', '');
        Severity: Major
        Found in modules/cms/client/js/block-editor.js and 1 other location - About 2 hrs to fix
        modules/cms/client/js/block-editor.js on lines 321..329

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

        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 updateEditButton(block, bounds) {
                BlockEditor.updateEditButtonPosition(bounds);
        
                if (BlockEditor.activeBlock !== block) {
                    BlockEditor.editButton.setAttribute('data-target-change', '');
        Severity: Major
        Found in modules/cms/client/js/block-editor.js and 1 other location - About 2 hrs to fix
        modules/cms/client/js/block-editor.js on lines 357..365

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

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

        function file(fileName, schema, dirname) {
            console.log(chalk.green('Generationg'), chalk.yellow(fileName));
            let number = +schema.$number || 10,
                results = [];
        
        
        Severity: Major
        Found in bin/lorem.js - About 2 hrs to fix

          Function choice has 53 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          Upload.prototype.choice = function (event) {
          
              var self = this,
                  files1 = Array.prototype.slice.apply(event.target.files || []),
                  files2 = Array.prototype.slice.apply(event.dataTransfer ? event.dataTransfer.files || [] : []);
          Severity: Major
          Found in modules/core/client/js/upload.js - About 2 hrs to fix

            Function video_return has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              function video_return(state, silent) {
                var serviceEnd,
                  serviceStart,
                  token,
                  oldPos = state.pos;
            Severity: Major
            Found in modules/cms/shared/video/viewmode.js - About 2 hrs to fix

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

              module.exports = (dust) => {
                dust.filters.media = function (value) {
                    var returnString = '';
                    if (value.mime === 'video/youtube') {
                        returnString += '<iframe type="text/html" src="https://www.youtube.com/embed/' + isYoutube(value.source) + '" frameborder="0"></iframe>';
              Severity: Major
              Found in modules/core/shared/dust/media.js - About 2 hrs to fix

                Function exports has 51 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/session.js - About 2 hrs to fix

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

                  module.exports = (dust) => {
                  
                    dust.helpers.block = function (chunk, context, bodies, params) {
                      SCli.debug('lackey-cms/modules/cms/server/lib/dust/block');
                  
                  
                  Severity: Minor
                  Found in modules/cms/server/lib/dust/block.js - About 2 hrs to fix

                    Function media has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      dust.filters.media = function (value) {
                        var returnString = '';
                        if (value.mime === 'video/youtube') {
                            returnString += '<iframe type="text/html" src="https://www.youtube.com/embed/' + isYoutube(value.source) + '" frameborder="0"></iframe>';
                          } else if (value.mime === 'video/vimeo') {
                    Severity: Minor
                    Found in modules/cms/server/lib/dust/media.js - About 2 hrs to fix

                      Function set has 50 lines of code (exceeds 25 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 2 hrs to fix

                        Function dictionary has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                                    .map(key => {
                                        let value = data.dictionary[key];
                                        if (Array.isArray(value)) {
                                            return {
                                                type: 'select',
                        Severity: Minor
                        Found in modules/cms/client/js/manager/structure.ui.js - About 2 hrs to fix

                          Consider simplifying this complex logical expression.
                          Open

                                                  if (isNew && ret.length > 0) {
                                                      throw(new Error('Identity already exists'));
                                                  } else {
                                                      return objection.transaction(Identities, function (BoundIdentities) {
                                                          return SCli
                          Severity: Critical
                          Found in modules/core/server/models/user/index.js - About 2 hrs to fix

                            Function media has 50 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              dust.filters.media = function (value) {
                                  var returnString = '';
                                  if (value.mime === 'video/youtube') {
                                      returnString += '<iframe type="text/html" src="https://www.youtube.com/embed/' + isYoutube(value.source) + '" frameborder="0"></iframe>';
                                    } else if (value.mime === 'video/vimeo') {
                            Severity: Minor
                            Found in modules/core/shared/dust/media.js - About 2 hrs to fix

                              Function crawl has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              function crawl(data) {
                                  SCli.debug(MODULE_NAME, 'crawl');
                                  if (!data) {
                                      return Promise.resolve(data);
                                  }
                              Severity: Minor
                              Found in modules/core/server/models/content/serializer.js - About 1 hr to fix

                                Function path has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    dust.helpers.path = function (chunk, context, bodies, params) {
                                
                                        let root = params.root || null,
                                            prefixIfParent = params.prefixIfParent || '',
                                            parent = (params.parent && params.parent.replace(/^\s+|\s+/g).length > 0) ? prefixIfParent + params.parent : null,
                                Severity: Minor
                                Found in modules/core/shared/dust/path.js - About 1 hr to fix
                                  Severity
                                  Category
                                  Status
                                  Source
                                  Language