pasalino/TinyLanding

View on GitHub

Showing 46 of 46 total issues

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

    setup: function() {
      if (this.isReady) return;

      var self = this;

Severity: Minor
Found in app/templates/scripts/parallax.js - About 1 hr to fix

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

            if ($('.' + target + '[data-id=' + number + ']').hasClass('go')) {
                $('.' + target + '[data-id=' + number + ']').addClass('goAway');
                $('.' + target + '[data-id=' + number + ']').removeClass('go');
            } else {
                $('.' + target + '[data-id=' + number + ']').addClass('go');
    Severity: Major
    Found in app/templates/scripts/css3-animate-it.js and 1 other location - About 1 hr to fix
    app/templates/scripts/css3-animate-it.js on lines 422..428

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

    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

                if ($('.' + target + '[data-id=' + number + ']').hasClass('go')) {
                    $('.' + target + '[data-id=' + number + ']').addClass('goAway');
                    $('.' + target + '[data-id=' + number + ']').removeClass('go');
                } else {
                    $('.' + target + '[data-id=' + number + ']').addClass('go');
    Severity: Major
    Found in app/templates/scripts/css3-animate-it.js and 1 other location - About 1 hr to fix
    app/templates/scripts/css3-animate-it.js on lines 409..415

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

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

      landingList: async (args) => {
        const { hash, order } = { ...landingListDefaultParams, ...args };
    
        let orderingColumns;
        switch (order) {
    Severity: Minor
    Found in bin/landing.js - About 1 hr to fix

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

      module.exports = (sequelize, DataTypes) => {
        const LandingPage = sequelize.define(
          'LandingPage', {
            name: {
              type: DataTypes.STRING(50),
      Severity: Minor
      Found in app/db/models/product.js - About 1 hr to fix

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

            args
              .option('name', {
                alias: 'n',
                describe: 'Name of landing page',
              })
        Severity: Major
        Found in bin/manage.js and 1 other location - About 1 hr to fix
        bin/manage.js on lines 34..46

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

        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

            args
              .positional('name', {
                alias: 'n',
                describe: 'Name of landing page',
              })
        Severity: Major
        Found in bin/manage.js and 1 other location - About 1 hr to fix
        bin/manage.js on lines 50..62

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

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

        const leadsPost = async (req, res, next) => {
          const data = req.body;
          debugInfo(data);
        
          if (!data.name || !data.name.trim()) {
        Severity: Minor
        Found in app/controllers/landingApiController.js - About 1 hr to fix

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

          module.exports = (app) => {
            app.use((req, res, next) => {
              res.oldRender = res.render;
              res.render = (view, options) => {
                this.oldRender(view, options, (err, html) => {
          Severity: Minor
          Found in app/middlewares/production.js - About 1 hr to fix

            Function FooterMiddleware has 30 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

              FooterMiddleware: (app) => {
                const isProduction = app.get('env') === 'production';
            
                app.use((req, res, next) => {
                  next(createError(404, 'Error 404 not found'));
            Severity: Minor
            Found in app/middlewares/express.js - About 1 hr to fix

              Function Waypoint has 29 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  function Waypoint(options) {
                      if (!options) {
                          throw new Error('No options passed to Waypoint constructor')
                      }
                      if (!options.element) {
              Severity: Minor
              Found in app/templates/scripts/jquery.waypoints.js - About 1 hr to fix

                Function landingAdd has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
                Open

                  landingAdd: async (args) => {
                    const { name, slug, verbose } = { ...args, ...{} };
                    if (!name) {
                      console.log(chalk.red('⛔️ Name is required for create new landing'));
                      return null;
                Severity: Minor
                Found in bin/landing.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

                Consider simplifying this complex logical expression.
                Open

                        if (top + $element.height() >= window_top &&
                            top - ($element.data('appear-top-offset') || 0) <= window_top + $window.height() &&
                            left + $element.width() >= window_left &&
                            left - ($element.data('appear-left-offset') || 0) <= window_left + $window.width()) {
                            return true;
                Severity: Major
                Found in app/templates/scripts/css3-animate-it.js - About 40 mins to fix

                  Consider simplifying this complex logical expression.
                  Open

                        if (!self.naturalHeight || !self.naturalWidth) {
                          self.naturalHeight = this.naturalHeight || this.height || 1;
                          self.naturalWidth  = this.naturalWidth  || this.width  || 1;
                        }
                  Severity: Major
                  Found in app/templates/scripts/parallax.js - About 40 mins to fix

                    Function leadsPost has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                    Open

                    const leadsPost = async (req, res, next) => {
                      const data = req.body;
                      debugInfo(data);
                    
                      if (!data.name || !data.name.trim()) {
                    Severity: Minor
                    Found in app/controllers/landingApiController.js - About 35 mins 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

                        if (fs.existsSync(publicPath)) {
                          console.log(chalk.red(`⛔️ Public folder '${publicPath}' already exists!`));
                          return null;
                        }
                    Severity: Minor
                    Found in bin/landing.js and 1 other location - About 35 mins to fix
                    bin/landing.js on lines 106..109

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

                    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

                            for (var i = 0, end = allWaypointsArray.length; i < end; i++) {
                                allWaypointsArray[i][method]()
                            }
                    Severity: Minor
                    Found in app/templates/scripts/jquery.waypoints.js and 1 other location - About 35 mins to fix
                    app/templates/scripts/jquery.waypoints.js on lines 353..355

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

                    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 (fs.existsSync(viewPath)) {
                          console.log(chalk.red(`⛔️ View folder '${viewPath}' already exists!`));
                          return null;
                        }
                    Severity: Minor
                    Found in bin/landing.js and 1 other location - About 35 mins to fix
                    bin/landing.js on lines 102..105

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

                    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

                            for (var i = 0, end = allWaypoints.length; i < end; i++) {
                                allWaypoints[i].destroy()
                            }
                    Severity: Minor
                    Found in app/templates/scripts/jquery.waypoints.js and 1 other location - About 35 mins to fix
                    app/templates/scripts/jquery.waypoints.js on lines 104..106

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

                    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

                    Avoid too many return statements within this function.
                    Open

                          return null;
                    Severity: Major
                    Found in bin/landing.js - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language