tmaiaroto/telepathic-black-panther

View on GitHub

Showing 60 of 76 total issues

File telepathic-black-panther.js has 1103 lines of code (exceeds 250 allowed). Consider refactoring.
Open

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/*
 * Cookies.js - 1.2.1
 * https://github.com/ScottHamper/Cookies
 *
Severity: Major
Found in dev/js/telepathic-black-panther.js - About 2 days to fix

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

},{}],7:[function(require,module,exports){
/**
 * The engagement.js module includes functions that track events related to a visitor's behavior
 * and level of engagement. How are visitors engaging with a page? Are they reading the content? 
 * Commenting? Filling out forms? Or are they getting stuck on forms? Do they abandom them?
Severity: Minor
Found in dev/js/telepathic-black-panther.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

Function 7 has 379 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],7:[function(require,module,exports){
/**
 * The engagement.js module includes functions that track events related to a visitor's behavior
 * and level of engagement. How are visitors engaging with a page? Are they reading the content? 
 * Commenting? Filling out forms? Or are they getting stuck on forms? Do they abandom them?
Severity: Major
Found in dev/js/telepathic-black-panther.js - About 1 day to fix

Function 1 has a Cognitive Complexity of 86 (exceeds 5 allowed). Consider refactoring.
Open

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/*
 * Cookies.js - 1.2.1
 * https://github.com/ScottHamper/Cookies
 *
Severity: Minor
Found in dev/js/telepathic-black-panther.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 2 has 179 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],2:[function(require,module,exports){
/*! minibus - v3.1.0 - 2014-11-22
 * https://github.com/axelpale/minibus
 *
 * Copyright (c) 2014 Akseli Palen <akseli.palen@gmail.com>;
Severity: Major
Found in dev/js/telepathic-black-panther.js - About 7 hrs to fix

Function 10 has 142 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],10:[function(require,module,exports){
(function() {
    // Make this available on the window for convenience and as $ki so it doesn't conflict with $
    window.$ki = require('./ki.ie8.js');

Severity: Major
Found in dev/js/telepathic-black-panther.js - About 5 hrs to fix

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

},{}],5:[function(require,module,exports){
module.exports = {
    /**
     * In milliseconds, when this script has loaded. Not quite on DOM ready, but close.
     * Useful in mitigating false engagements, etc.
Severity: Minor
Found in dev/js/telepathic-black-panther.js - About 5 hrs 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 engagement.js has 379 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/**
 * The engagement.js module includes functions that track events related to a visitor's behavior
 * and level of engagement. How are visitors engaging with a page? Are they reading the content? 
 * Commenting? Filling out forms? Or are they getting stuck on forms? Do they abandom them?
 * These kind of questions are answered by the events this module sends to GA.
Severity: Minor
Found in src/engagement.js - About 5 hrs to fix

Function 1 has 112 lines of code (exceeds 25 allowed). Consider refactoring.
Open

(function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
/*
 * Cookies.js - 1.2.1
 * https://github.com/ScottHamper/Cookies
 *
Severity: Major
Found in dev/js/telepathic-black-panther.js - About 4 hrs to fix

Function inactivity has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

    inactivity: function(opts) {
        opts = this.extend({
            "_method": "inactivity",
            "category": "behavior",
            "action": "inactive",
Severity: Minor
Found in src/engagement.js - About 4 hrs 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 3 has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

},{}],3:[function(require,module,exports){
/**
 * Figures things out.
*/
module.exports = {
Severity: Minor
Found in dev/js/telepathic-black-panther.js - About 3 hrs 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 factory has 96 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    var factory = function (window) {
        if (typeof window.document !== 'object') {
            throw new Error('Cookies.js requires a `window` with a `document` object');
        }
Severity: Major
Found in dev/js/telepathic-black-panther.js - About 3 hrs to fix

Function timeToEngage has a Cognitive Complexity of 25 (exceeds 5 allowed). Consider refactoring.
Open

    timeToEngage: function(opts) {
        opts = this.extend({
            "_method": "timeToEngage",
            "category": "behavior",
            "action": "timeToEngage",
Severity: Minor
Found in src/engagement.js - About 3 hrs 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 8 has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
Open

},{}],8:[function(require,module,exports){
/*!
 * ki.js - jQuery-like API super-tiny JavaScript library
 * Copyright (c) 2014 Denis Ciccale (@tdecs)
 * Released under MIT license
Severity: Minor
Found in dev/js/telepathic-black-panther.js - About 3 hrs 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 Tbp has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function Tbp(config) {
            // Tbp() or new Tbp() will work this way.
            if (!(this instanceof Tbp)) return new Tbp(config);

            // Shortcut Google Analytics, provide empty function if it doesn't exist so things don't bark at us elsewhere.
Severity: Major
Found in dev/js/telepathic-black-panther.js - About 3 hrs to fix

Function Tbp has 81 lines of code (exceeds 25 allowed). Consider refactoring.
Open

        function Tbp(config) {
            // Tbp() or new Tbp() will work this way.
            if (!(this instanceof Tbp)) return new Tbp(config);

            // Shortcut Google Analytics, provide empty function if it doesn't exist so things don't bark at us elsewhere.
Severity: Major
Found in src/main.js - About 3 hrs to fix

Function 9 has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

},{}],9:[function(require,module,exports){
module.exports = {
    first: function() {
        return $ki(this[0]);
    },
Severity: Minor
Found in dev/js/telepathic-black-panther.js - About 2 hrs 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 getTargetName has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring.
Open

    getTargetName: function(element) {
        var tgtStr = "";
        if(element) {
            // $ki() can return an array. If there's only one item in it. Try that.
            if(element.tagName === undefined && element.length == 1) {
Severity: Minor
Found in src/core.js - About 2 hrs 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 9 has 70 lines of code (exceeds 25 allowed). Consider refactoring.
Open

},{}],9:[function(require,module,exports){
module.exports = {
    first: function() {
        return $ki(this[0]);
    },
Severity: Major
Found in dev/js/telepathic-black-panther.js - About 2 hrs to fix

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

module.exports = function(grunt) {

    grunt.initConfig({
        pkg: grunt.file.readJSON('package.json'),
        browserify: {
Severity: Major
Found in Gruntfile.js - About 2 hrs to fix
Severity
Category
Status
Source
Language