Showing 16 of 60 total issues
Function 1
has 1376 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.CycleHammer = f()}})(function(){var define,module,exports;return (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){
/*! Hammer.JS - v2.0.4 - 2014-09-28
* http://hammerjs.github.io/
*
* Copyright (c) 2014 Jorik Tangelder;
File cycle-hammer.js
has 1718 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.CycleHammer = f()}})(function(){var define,module,exports;return (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){
/*! Hammer.JS - v2.0.4 - 2014-09-28
* http://hammerjs.github.io/
*
* Copyright (c) 2014 Jorik Tangelder;
Function 6
has 174 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"./hammerDriver":4}],6:[function(require,module,exports){
/**
* @fileoverview Standard Event Types
* @author Frederik Krautwald
* @copyright 2015 Cyclic Materials. All rights reserved.
Function 3
has 75 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"./makeHammerDriver":5}],3:[function(require,module,exports){
(function (global){
/**
* @fileoverview Observable from Hammer Event
* @author Frederik Krautwald
Function 4
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
},{"hammerjs":1}],4:[function(require,module,exports){
(function (global){
/**
* @fileoverview Hammer driver
* @author Frederik Krautwald
Function getTouches
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function getTouches(ev, type) {
var allTouches = toArray(ev.touches);
var targetIds = this.targetIds;
// when there is only one touch, the process can be simplified
Function process
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
process: function(input) {
var options = this.options;
var validPointers = input.pointers.length === options.pointers;
var validMovement = input.distance < options.threshold;
Function computeInputData
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
function computeInputData(manager, input) {
var session = manager.session;
var pointers = input.pointers;
var pointersLength = pointers.length;
Function PEhandler
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
handler: function PEhandler(ev) {
var store = this.store;
var removePointer = false;
var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
Function recognize
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
recognize: function(inputData) {
var session = this.session;
if (session.stopped) {
return;
}
Function makeEventsSelector
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
function makeEventsSelector(api, originalEvents) {
return function events(eventType) {
for (var _len = arguments.length, rest = Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
rest[_key - 1] = arguments[_key];
}
- 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
Avoid too many return
statements within this function. Open
Open
return '';
Avoid too many return
statements within this function. Open
Open
return STATE_FAILED;
Avoid too many return
statements within this function. Open
Open
return '';
Avoid too many return
statements within this function. Open
Open
return TOUCH_ACTION_AUTO;
Avoid too many return
statements within this function. Open
Open
return STATE_FAILED;