Showing 28 of 46 total issues
File jquery.waypoints.js
has 508 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
Waypoints - 4.0.1
Copyright © 2011-2016 Caleb Troughton
Licensed under the MIT license.
https://github.com/imakewebthings/waypoints/blob/master/licenses.txt
Function Parallax
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Parallax(element, options) {
var self = this;
if (typeof options == 'object') {
delete options.refresh;
File parallax.js
has 323 lines of code (exceeds 250 allowed). Consider refactoring. Open
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)
*/
Function refresh
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
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()
Function exports
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = async (args) => {
const {
name, slug, id, f, order, limit,
} = args;
console.log(args);
Function sendMessage
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function sendMessage() {
$('#send_lead').on('click', function (e) {
e.preventDefault();
var busy = false;
var form = $("#lead");
Function p_doTimeout
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function p_doTimeout(jquery_data_key) {
var that = this,
elem,
data = {},
Function exports
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
Open
module.exports = async (args) => {
const {
name, slug, id, f, order, limit,
} = args;
console.log(args);
- Read upRead up
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
Open
landingAdd: async (args) => {
const { name, slug, verbose } = { ...args, ...{} };
if (!name) {
console.log(chalk.red('⛔️ Name is required for create new landing'));
return null;
Function refresh
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
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;
Function handleScroll
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
Context.prototype.handleScroll = function () {
var triggeredGroups = {}
var axes = {
horizontal: {
newScroll: this.adapter.scrollLeft(),
Function exports
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (sequelize, DataTypes) => {
const Lead = sequelize.define(
'Lead', {
name: {
type: DataTypes.STRING(500),
Function setup
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
setup: function() {
if (this.isReady) return;
var self = this;
Function landingList
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
landingList: async (args) => {
const { hash, order } = { ...landingListDefaultParams, ...args };
let orderingColumns;
switch (order) {
Function exports
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (sequelize, DataTypes) => {
const LandingPage = sequelize.define(
'LandingPage', {
name: {
type: DataTypes.STRING(50),
Function leadsPost
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
const leadsPost = async (req, res, next) => {
const data = req.body;
debugInfo(data);
if (!data.name || !data.name.trim()) {
Function exports
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
module.exports = (app) => {
app.use((req, res, next) => {
res.oldRender = res.render;
res.render = (view, options) => {
this.oldRender(view, options, (err, html) => {
Function FooterMiddleware
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
FooterMiddleware: (app) => {
const isProduction = app.get('env') === 'production';
app.use((req, res, next) => {
next(createError(404, 'Error 404 not found'));
Function Waypoint
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function Waypoint(options) {
if (!options) {
throw new Error('No options passed to Waypoint constructor')
}
if (!options.element) {
Function landingAdd
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
Open
landingAdd: async (args) => {
const { name, slug, verbose } = { ...args, ...{} };
if (!name) {
console.log(chalk.red('⛔️ Name is required for create new landing'));
return null;
- Read upRead up
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"