pasalino/TinyLanding

View on GitHub

Showing 46 of 46 total issues

File jquery.waypoints.js has 508 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/*!
Waypoints - 4.0.1
Copyright © 2011-2016 Caleb Troughton
Licensed under the MIT license.
https://github.com/imakewebthings/waypoints/blob/master/licenses.txt
Severity: Major
Found in app/templates/scripts/jquery.waypoints.js - About 1 day to fix

    Function Parallax has 94 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      function Parallax(element, options) {
        var self = this;
    
        if (typeof options == 'object') {
          delete options.refresh;
    Severity: Major
    Found in app/templates/scripts/parallax.js - About 3 hrs to fix

      File parallax.js has 323 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      /*!
       * parallax.js v1.5.0 (http://pixelcog.github.io/parallax.js/)
       * @copyright 2016 PixelCog, Inc.
       * @license MIT (https://github.com/pixelcog/parallax.js/blob/master/LICENSE)
       */
      Severity: Minor
      Found in app/templates/scripts/parallax.js - About 3 hrs to fix

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

            if (navigator.userAgent.match(/(Android)/)) {
              if (this.imageSrc && this.androidFix && !this.$element.is('img')) {
                this.$element.css({
                  backgroundImage: 'url(' + this.imageSrc + ')',
                  backgroundSize: 'cover',
        Severity: Major
        Found in app/templates/scripts/parallax.js and 1 other location - About 3 hrs to fix
        app/templates/scripts/parallax.js on lines 93..102

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

        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 (navigator.userAgent.match(/(iPod|iPhone|iPad)/)) {
              if (this.imageSrc && this.iosFix && !this.$element.is('img')) {
                this.$element.css({
                  backgroundImage: 'url(' + this.imageSrc + ')',
                  backgroundSize: 'cover',
        Severity: Major
        Found in app/templates/scripts/parallax.js and 1 other location - About 3 hrs to fix
        app/templates/scripts/parallax.js on lines 104..113

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

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

            Context.prototype.refresh = function () {
                /*eslint-disable eqeqeq */
                var isWindow = this.element == this.element.window
                /*eslint-enable eqeqeq */
                var contextOffset = isWindow ? undefined : this.adapter.offset()
        Severity: Major
        Found in app/templates/scripts/jquery.waypoints.js - About 2 hrs to fix

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

          module.exports = async (args) => {
            const {
              name, slug, id, f, order, limit,
            } = args;
            console.log(args);
          Severity: Major
          Found in bin/leads.js - About 2 hrs to fix

            Function sendMessage has 57 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            function sendMessage() {
              $('#send_lead').on('click', function (e) {
                e.preventDefault();
                var busy = false;
                var form = $("#lead");
            Severity: Major
            Found in app/templates/scripts/main.js - About 2 hrs to fix

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

                          vertical: {
                              contextOffset: isWindow ? 0 : contextOffset.top,
                              contextScroll: isWindow ? 0 : this.oldScroll.y,
                              contextDimension: this.innerHeight(),
                              oldScroll: this.oldScroll.y,
              Severity: Major
              Found in app/templates/scripts/jquery.waypoints.js and 1 other location - About 2 hrs to fix
              app/templates/scripts/jquery.waypoints.js on lines 370..378

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

              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

                          horizontal: {
                              contextOffset: isWindow ? 0 : contextOffset.left,
                              contextScroll: isWindow ? 0 : this.oldScroll.x,
                              contextDimension: this.innerWidth(),
                              oldScroll: this.oldScroll.x,
              Severity: Major
              Found in app/templates/scripts/jquery.waypoints.js and 1 other location - About 2 hrs to fix
              app/templates/scripts/jquery.waypoints.js on lines 379..387

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

              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 (this.positionY != 'top' && this.positionY != 'bottom') {
                    if (isNaN(parseInt(this.positionY))) {
                      this.positionY = 'center';
                    } else {
                      this.positionY = parseInt(this.positionY);
              Severity: Major
              Found in app/templates/scripts/parallax.js and 1 other location - About 2 hrs to fix
              app/templates/scripts/parallax.js on lines 73..79

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

              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 (this.positionX != 'left' && this.positionX != 'right') {
                    if (isNaN(parseInt(this.positionX))) {
                      this.positionX = 'center';
                    } else {
                      this.positionX = parseInt(this.positionX);
              Severity: Major
              Found in app/templates/scripts/parallax.js and 1 other location - About 2 hrs to fix
              app/templates/scripts/parallax.js on lines 81..87

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

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

                  function p_doTimeout(jquery_data_key) {
                      var that = this,
                          elem,
                          data = {},
              
              
              Severity: Major
              Found in app/templates/scripts/css3-animate-it.js - About 2 hrs to fix

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

                module.exports = async (args) => {
                  const {
                    name, slug, id, f, order, limit,
                  } = args;
                  console.log(args);
                Severity: Minor
                Found in bin/leads.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

                    Context.prototype.innerWidth = function () {
                        /*eslint-disable eqeqeq */
                        if (this.element == this.element.window) {
                            return Waypoint.viewportWidth()
                        }
                Severity: Major
                Found in app/templates/scripts/jquery.waypoints.js and 1 other location - About 1 hr to fix
                app/templates/scripts/jquery.waypoints.js on lines 319..326

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

                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

                    Context.prototype.innerHeight = function () {
                        /*eslint-disable eqeqeq */
                        if (this.element == this.element.window) {
                            return Waypoint.viewportHeight()
                        }
                Severity: Major
                Found in app/templates/scripts/jquery.waypoints.js and 1 other location - About 1 hr to fix
                app/templates/scripts/jquery.waypoints.js on lines 335..342

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

                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 landingAdd has 45 lines of code (exceeds 25 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

                  Function refresh has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      refresh: function() {
                        this.boxWidth        = this.$element.outerWidth();
                        this.boxHeight       = this.$element.outerHeight() + this.bleed * 2;
                        this.boxOffsetTop    = this.$element.offset().top - this.bleed;
                        this.boxOffsetLeft   = this.$element.offset().left;
                  Severity: Minor
                  Found in app/templates/scripts/parallax.js - About 1 hr to fix

                    Function handleScroll has 41 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        Context.prototype.handleScroll = function () {
                            var triggeredGroups = {}
                            var axes = {
                                horizontal: {
                                    newScroll: this.adapter.scrollLeft(),
                    Severity: Minor
                    Found in app/templates/scripts/jquery.waypoints.js - About 1 hr to fix

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

                      module.exports = (sequelize, DataTypes) => {
                        const Lead = sequelize.define(
                          'Lead', {
                            name: {
                              type: DataTypes.STRING(500),
                      Severity: Minor
                      Found in app/db/models/lead.js - About 1 hr to fix
                        Severity
                        Category
                        Status
                        Source
                        Language