Showing 11 of 25 total issues
File ratchet.js
has 681 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
/*!
* =====================================================
* Ratchet v2.0.2 (http://goratchet.com)
* Copyright 2014 Connor Sears
* Licensed under MIT (https://github.com/twbs/ratchet/blob/master/LICENSE)
Consider simplifying this complex logical expression. Open
Open
if (!target ||
e.which > 1 ||
e.metaKey ||
e.ctrlKey ||
isScrolling ||
Function router
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
Open
var router = (function () {
"use strict";
var routes = [];
- 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 swapContent
has 60 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var swapContent = function (swap, container, transition, complete) {
var enter;
var containerDirection;
var swapDirection;
Function popstate
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var popstate = function (e) {
var key;
var barElement;
var activeObj;
var activeDom;
Function render
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
render: function () {
return (
<div className={"page " + this.props.position}>
<Header text="Employee" back="true"/>
<div className="card">
Function PUSH
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var PUSH = function (options) {
var key;
var xhr = PUSH.xhr;
options.container = options.container || options.transition ? document.querySelector('.content') : document.body;
Function success
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var success = function (xhr, options) {
var key;
var barElement;
var data = parseXHR(xhr, options);
Function router
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var router = (function () {
"use strict";
var routes = [];
Function parseXHR
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
var parseXHR = function (xhr, options) {
var head;
var body;
var data = {};
var responseText = xhr.responseText;
Avoid too many return
statements within this function. Open
Open
return (handle.style.webkitTransform = 'translate3d(' + offset + 'px,0,0)');