getlackey/lackey-cms

View on GitHub

Showing 527 of 527 total issues

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

    .then((Taggable, Role, knex) => {

        SCli.debug(__MODULE_NAME, 'READY');

        /**
Severity: Major
Found in modules/core/server/models/user/index.js - About 4 days to fix

    Identical blocks of code found in 2 locations. 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: Major
    Found in modules/core/shared/dust/media.js and 1 other location - About 3 days to fix
    modules/cms/server/lib/dust/media.js on lines 148..203

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

    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

      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: Major
    Found in modules/cms/server/lib/dust/media.js and 1 other location - About 3 days to fix
    modules/core/shared/dust/media.js on lines 8..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 648.

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

        .then((knex) => {
            return knex
                .schema
                .dropTableIfExists('objection')
                .then(() => {
    Severity: Major
    Found in modules/core/server/models/objection/index.js - About 3 days to fix

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

          .then((knex) => {
      
              SCli.debug(__MODULE_NAME, 'Knex initted');
      
              return Schema
      Severity: Major
      Found in modules/core/server/models/knex.js - About 2 days to fix

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

            .then((knex) => {
                return knex
                    .schema
                    .dropTableIfExists('objection')
                    .then(() => {
        Severity: Minor
        Found in modules/core/server/models/objection/index.js - About 2 days 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 index.js has 853 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: Major
        Found in modules/core/server/models/user/index.js - About 2 days to fix

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

              .then((Taggable, User, Taxonomy, TaxonomyType, Template, knexSchema, QueryBuilder, configuration) => {
          
                  SCli.debug(__MODULE_NAME, 'READY');
          
                  class ContentModel extends Model {
          Severity: Major
          Found in modules/core/server/models/content/index.js - About 1 day to fix

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

                .then((Taggable, Role, knex) => {
            
                    SCli.debug(__MODULE_NAME, 'READY');
            
                    /**
            Severity: Minor
            Found in modules/core/server/models/user/index.js - About 1 day 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 363 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                .then((ContentModel, Taxonomy, TaxonomyType, Template, User, Preview) => {
            
                    class PageController {
            
                        static preview(req, res, next) {
            Severity: Major
            Found in modules/cms/server/controllers/page.js - About 1 day to fix

              File structure.ui.js has 740 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              /* eslint no-cond-assign:0, no-new:0, no-unused-vars:0 */
              /* jslint browser:true, node:true, esnext:true */
              'use strict';
              /*
                  Copyright 2016 Enigma Marketing Services Limited
              Severity: Major
              Found in modules/cms/client/js/manager/structure.ui.js - About 1 day to fix

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

                    .then((Taggable, QueryBuilder) => {
                
                        SCli.debug(__MODULE_NAME, 'READY');
                
                        class MediaModel extends Model {
                Severity: Major
                Found in modules/core/server/models/media/index.js - About 1 day to fix

                  Function format has a Cognitive Complexity of 82 (exceeds 5 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: Minor
                  Found in lib/server/init/format.js - About 1 day 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 table.js has 643 lines of code (exceeds 250 allowed). Consider refactoring.
                  Open

                  /* jslint node:true, esnext:true, es6:true, browser:true, loopfunc:true*/
                  /* eslint no-param-reassign:0 no-alert:0 */
                  'use strict';
                  /*
                      Copyright 2016 Enigma Marketing Services Limited
                  Severity: Major
                  Found in modules/core/client/js/table.js - About 1 day to fix

                    File index.js has 636 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: Major
                    Found in modules/core/server/models/objection/index.js - About 1 day to fix

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

                          .then((Taggable, TaxonomyType) => {
                      
                              SCli.debug(__MODULE_NAME, 'READY');
                      
                              /**
                      Severity: Major
                      Found in modules/core/server/models/template/index.js - About 1 day to fix

                        Function print has a Cognitive Complexity of 65 (exceeds 5 allowed). Consider refactoring.
                        Open

                        function print(chunk, data, type, editMode, dust, log, config) {
                          let source;
                        
                          SCli.debug('lackey-cms/modules/cms/server/lib/dust/media', 'Print', JSON.stringify(data, null, 4));
                        
                        
                        Severity: Minor
                        Found in modules/cms/server/lib/dust/media.js - About 1 day 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 5 locations. Consider refactoring.
                        Open

                                return Schema
                                    //
                                    // TABLE Users
                                    //
                                    .table(knex, 'users', table => {
                        Severity: Major
                        Found in modules/core/server/models/knex.js and 4 other locations - About 1 day to fix
                        modules/core/server/models/knex.js on lines 34..487
                        modules/core/server/models/knex.js on lines 34..516
                        modules/core/server/models/knex.js on lines 34..546
                        modules/core/server/models/knex.js on lines 34..578

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

                        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 60 (exceeds 5 allowed). Consider refactoring.
                        Open

                            .then((knex) => {
                        
                                class ContentQueryBuilder {
                        
                                    constructor() {
                        Severity: Minor
                        Found in modules/core/server/models/content/querybuilder.js - About 1 day 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

                                    invalidateToken(token) {
                        
                                        SCli.debug(__MODULE_NAME, 'invalidateToken');
                        
                                        let self = this;
                        Severity: Major
                        Found in modules/core/server/models/user/index.js and 1 other location - About 1 day to fix
                        modules/core/server/models/user/index.js on lines 516..544

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

                        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