pasalino/TinyLanding

View on GitHub

Showing 28 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

        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

              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

                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

                        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

                          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

                              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

                                      Severity
                                      Category
                                      Status
                                      Source
                                      Language