CyclicMaterials/cycle-hammer-driver

View on GitHub
dist/cycle-hammer.js

Summary

Maintainability
F
3 wks
Test Coverage

Function 1 has 1376 lines of code (exceeds 25 allowed). Consider refactoring.
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;
Severity: Major
Found in dist/cycle-hammer.js - About 6 days to fix

    File cycle-hammer.js has 1718 lines of code (exceeds 250 allowed). Consider refactoring.
    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;
    Severity: Major
    Found in dist/cycle-hammer.js - About 4 days to fix

      Function 6 has 174 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      },{"./hammerDriver":4}],6:[function(require,module,exports){
      /**
       * @fileoverview Standard Event Types
       * @author Frederik Krautwald
       * @copyright 2015 Cyclic Materials. All rights reserved.
      Severity: Major
      Found in dist/cycle-hammer.js - About 6 hrs to fix

        Function 3 has 75 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        },{"./makeHammerDriver":5}],3:[function(require,module,exports){
        (function (global){
        /**
         * @fileoverview Observable from Hammer Event
         * @author Frederik Krautwald
        Severity: Major
        Found in dist/cycle-hammer.js - About 3 hrs to fix

          Function 4 has 57 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          },{"hammerjs":1}],4:[function(require,module,exports){
          (function (global){
          /**
           * @fileoverview Hammer driver
           * @author Frederik Krautwald
          Severity: Major
          Found in dist/cycle-hammer.js - About 2 hrs to fix

            Function getTouches has 38 lines of code (exceeds 25 allowed). Consider refactoring.
            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
            Severity: Minor
            Found in dist/cycle-hammer.js - About 1 hr to fix

              Function process has 36 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  process: function(input) {
                      var options = this.options;
              
                      var validPointers = input.pointers.length === options.pointers;
                      var validMovement = input.distance < options.threshold;
              Severity: Minor
              Found in dist/cycle-hammer.js - About 1 hr to fix

                Function computeInputData has 29 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                function computeInputData(manager, input) {
                    var session = manager.session;
                    var pointers = input.pointers;
                    var pointersLength = pointers.length;
                
                
                Severity: Minor
                Found in dist/cycle-hammer.js - About 1 hr to fix

                  Function PEhandler has 28 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                      handler: function PEhandler(ev) {
                          var store = this.store;
                          var removePointer = false;
                  
                          var eventTypeNormalized = ev.type.toLowerCase().replace('ms', '');
                  Severity: Minor
                  Found in dist/cycle-hammer.js - About 1 hr to fix

                    Function recognize has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                        recognize: function(inputData) {
                            var session = this.session;
                            if (session.stopped) {
                                return;
                            }
                    Severity: Minor
                    Found in dist/cycle-hammer.js - About 1 hr to fix

                      Avoid too many return statements within this function.
                      Open

                          return '';
                      Severity: Major
                      Found in dist/cycle-hammer.js - About 30 mins to fix

                        Avoid too many return statements within this function.
                        Open

                                return STATE_FAILED;
                        Severity: Major
                        Found in dist/cycle-hammer.js - About 30 mins to fix

                          Avoid too many return statements within this function.
                          Open

                              return '';
                          Severity: Major
                          Found in dist/cycle-hammer.js - About 30 mins to fix

                            Avoid too many return statements within this function.
                            Open

                                return TOUCH_ACTION_AUTO;
                            Severity: Major
                            Found in dist/cycle-hammer.js - About 30 mins to fix

                              Avoid too many return statements within this function.
                              Open

                                      return STATE_FAILED;
                              Severity: Major
                              Found in dist/cycle-hammer.js - About 30 mins to fix

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                var standardEventTypes = {
                                  abort: true,
                                  afterprint: true,
                                  animationend: true,
                                  animationiteration: true,
                                Severity: Major
                                Found in dist/cycle-hammer.js and 1 other location - About 5 days to fix
                                lib/standardEventTypes.js on lines 13..181

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 875.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                function fromEvent(_ref3) {
                                  var element = _ref3.element;
                                  var eventType = _ref3.eventType;
                                  var k = _ref3.k;
                                  var callback = _ref3.callback;
                                Severity: Major
                                Found in dist/cycle-hammer.js and 1 other location - About 1 day to fix
                                lib/fromEvent.js on lines 63..91

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 212.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                function createEventListener(_ref2) {
                                  var element = _ref2.element;
                                  var eventType = _ref2.eventType;
                                  var handler = _ref2.handler;
                                  var k = _ref2.k;
                                Severity: Major
                                Found in dist/cycle-hammer.js and 1 other location - About 7 hrs to fix
                                lib/fromEvent.js on lines 39..59

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 189.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                function createListener(_ref) {
                                  var element = _ref.element;
                                  var eventType = _ref.eventType;
                                  var handler = _ref.handler;
                                  var k = _ref.k;
                                Severity: Major
                                Found in dist/cycle-hammer.js and 1 other location - About 6 hrs to fix
                                lib/fromEvent.js on lines 23..37

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 161.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                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];
                                    }
                                Severity: Major
                                Found in dist/cycle-hammer.js and 1 other location - About 5 hrs to fix
                                lib/hammerDriver.js on lines 35..43

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 151.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                function selectCallback(originalSelect) {
                                  return function select() {
                                    for (var _len2 = arguments.length, args = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
                                      args[_key2] = arguments[_key2];
                                    }
                                Severity: Major
                                Found in dist/cycle-hammer.js and 1 other location - About 4 hrs to fix
                                lib/hammerDriver.js on lines 49..61

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 130.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                function fromHammerEvent(eventType, api, callback) {
                                  return api.observable.flatMapLatest(function (element) {
                                    if (!element) {
                                      return _rx.Observable.empty();
                                    }
                                Severity: Major
                                Found in dist/cycle-hammer.js and 1 other location - About 4 hrs to fix
                                lib/hammerDriver.js on lines 25..33

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 116.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    init: function() {
                                        this.evEl && addEventListeners(this.element, this.evEl, this.domHandler);
                                        this.evTarget && addEventListeners(this.target, this.evTarget, this.domHandler);
                                        this.evWin && addEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
                                    },
                                Severity: Major
                                Found in dist/cycle-hammer.js and 1 other location - About 3 hrs to fix
                                dist/cycle-hammer.js on lines 404..408

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 103.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    destroy: function() {
                                        this.evEl && removeEventListeners(this.element, this.evEl, this.domHandler);
                                        this.evTarget && removeEventListeners(this.target, this.evTarget, this.domHandler);
                                        this.evWin && removeEventListeners(getWindowForElement(this.element), this.evWin, this.domHandler);
                                    }
                                Severity: Major
                                Found in dist/cycle-hammer.js and 1 other location - About 3 hrs to fix
                                dist/cycle-hammer.js on lines 395..399

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 103.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                function hammerDriver(domDriverFunc, vTree$) {
                                  if (typeof domDriverFunc !== 'function') {
                                    throw new Error('First argument given to hammerDriver() must be a DOM driver function.');
                                  }
                                  if (!vTree$ || typeof vTree$.subscribe !== 'function') {
                                Severity: Major
                                Found in dist/cycle-hammer.js and 1 other location - About 2 hrs to fix
                                lib/hammerDriver.js on lines 63..75

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 83.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                function directionStr(direction) {
                                    if (direction == DIRECTION_DOWN) {
                                        return 'down';
                                    } else if (direction == DIRECTION_UP) {
                                        return 'up';
                                Severity: Major
                                Found in dist/cycle-hammer.js and 1 other location - About 2 hrs to fix
                                dist/cycle-hammer.js on lines 1496..1507

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 75.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                function stateStr(state) {
                                    if (state & STATE_CANCELLED) {
                                        return 'cancel';
                                    } else if (state & STATE_ENDED) {
                                        return 'end';
                                Severity: Major
                                Found in dist/cycle-hammer.js and 1 other location - About 2 hrs to fix
                                dist/cycle-hammer.js on lines 1514..1525

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 75.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                            if (options.direction & DIRECTION_HORIZONTAL) {
                                                direction = (x === 0) ? DIRECTION_NONE : (x < 0) ? DIRECTION_LEFT : DIRECTION_RIGHT;
                                                hasMoved = x != this.pX;
                                                distance = Math.abs(input.deltaX);
                                            } else {
                                Severity: Major
                                Found in dist/cycle-hammer.js and 1 other location - About 1 hr to fix
                                dist/cycle-hammer.js on lines 1653..1657

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 64.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                            } else {
                                                direction = (y === 0) ? DIRECTION_NONE : (y < 0) ? DIRECTION_UP : DIRECTION_DOWN;
                                                hasMoved = y != this.pY;
                                                distance = Math.abs(input.deltaY);
                                            }
                                Severity: Major
                                Found in dist/cycle-hammer.js and 1 other location - About 1 hr to fix
                                dist/cycle-hammer.js on lines 1649..1653

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 64.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    var x = p2[props[0]] - p1[props[0]],
                                        y = p2[props[1]] - p1[props[1]];
                                Severity: Minor
                                Found in dist/cycle-hammer.js and 1 other location - About 50 mins to fix
                                dist/cycle-hammer.js on lines 689..690

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 52.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                    var x = p2[props[0]] - p1[props[0]],
                                        y = p2[props[1]] - p1[props[1]];
                                Severity: Minor
                                Found in dist/cycle-hammer.js and 1 other location - About 50 mins to fix
                                dist/cycle-hammer.js on lines 672..673

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 52.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                function makeHammerDriver(domDriverFunc) {
                                  if (typeof domDriverFunc !== 'function') {
                                    throw new Error('First argument given to makeHammerDriver() ' + 'must be a DOM driver function.');
                                  }
                                  return _hammerDriver2['default'].bind({}, domDriverFunc);
                                Severity: Minor
                                Found in dist/cycle-hammer.js and 1 other location - About 45 mins to fix
                                lib/makeHammerDriver.js on lines 19..24

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 50.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                                    this._timer = setTimeoutContext(function() {
                                                        this.state = STATE_RECOGNIZED;
                                                        this.tryEmit();
                                                    }, options.interval, this);
                                Severity: Minor
                                Found in dist/cycle-hammer.js and 1 other location - About 35 mins to fix
                                dist/cycle-hammer.js on lines 1763..1766

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 47.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                            this._timer = setTimeoutContext(function() {
                                                this.state = STATE_RECOGNIZED;
                                                this.tryEmit();
                                            }, options.time, this);
                                Severity: Minor
                                Found in dist/cycle-hammer.js and 1 other location - About 35 mins to fix
                                dist/cycle-hammer.js on lines 1962..1965

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 47.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                function removeEventListeners(target, types, handler) {
                                    each(splitStr(types), function(type) {
                                        target.removeEventListener(type, handler, false);
                                    });
                                }
                                Severity: Minor
                                Found in dist/cycle-hammer.js and 1 other location - About 35 mins to fix
                                dist/cycle-hammer.js on lines 167..171

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 46.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                        this.callback(this.manager, type, {
                                            pointers: touches[0],
                                            changedPointers: touches[1],
                                            pointerType: INPUT_TYPE_TOUCH,
                                            srcEvent: ev
                                Severity: Minor
                                Found in dist/cycle-hammer.js and 1 other location - About 35 mins to fix
                                dist/cycle-hammer.js on lines 961..966

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 46.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Similar blocks of code found in 2 locations. Consider refactoring.
                                Open

                                function addEventListeners(target, types, handler) {
                                    each(splitStr(types), function(type) {
                                        target.addEventListener(type, handler, false);
                                    });
                                }
                                Severity: Minor
                                Found in dist/cycle-hammer.js and 1 other location - About 35 mins to fix
                                dist/cycle-hammer.js on lines 179..183

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 46.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                Identical blocks of code found in 2 locations. Consider refactoring.
                                Open

                                        this.callback(this.manager, type, {
                                            pointers: touches[0],
                                            changedPointers: touches[1],
                                            pointerType: INPUT_TYPE_TOUCH,
                                            srcEvent: ev
                                Severity: Minor
                                Found in dist/cycle-hammer.js and 1 other location - About 35 mins to fix
                                dist/cycle-hammer.js on lines 906..911

                                Duplicated Code

                                Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

                                Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

                                When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

                                Tuning

                                This issue has a mass of 46.

                                We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

                                The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

                                If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

                                See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

                                Refactorings

                                Further Reading

                                There are no issues that match your filters.

                                Category
                                Status