Showing 17 of 24 total issues
Function Controller
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Controller = function() {
'use strict';
Emitter.call(this);
const controllerConfig = config.getControllerConfig(),
Function Buttons
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
var Buttons = function(controller) {
var buttons = config.getControllerConfig().buttons;
// convert strings to numbers, e.g. "0x01" to 0x01
- 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 Controller
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
const Controller = function() {
'use strict';
Emitter.call(this);
const controllerConfig = config.getControllerConfig(),
- 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 Buttons
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Buttons = function(controller) {
var buttons = config.getControllerConfig().buttons;
// convert strings to numbers, e.g. "0x01" to 0x01
Function exports
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(grunt) {
grunt.initConfig({
watch: {
files: files,
tasks: ['default']
Function printcontrollerEvents
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
var printcontrollerEvents = function(controller, controllerConfiguration) {
'use strict';
controller.on('left:move', function(data) {
console.log('left Moved');
console.log(data);
Function outputSmoothing
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
var outputSmoothing = function(smoothInput) {
'use strict';
var buffer = {},
maxFrames = 5;
- 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 motionProcessor
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
var motionProcessor = function(controller) {
var varianceThreshhold = 1,
smoothInput = config.getOptions().accelerometerSmoothing,
outputSmoothing = new Smoothing(smoothInput),
Function Status
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
var Status = function(controller) {
var buffer = {},
status = config.getControllerConfig().status;
- 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 processButton
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
var processButton = function(button, data) {
//make sure the data contains a value for the specified block
//and bitwise operation for the button value
var block = data[button.buttonBlock] & button.mask;
Function TouchPad
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function TouchPad(controller) {
const touchPad = config.getControllerConfig().touchPad;
let pBuffer = {};
function processIsActive(buffer, tpAxis) {
- 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 Analogs
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Analogs = function(controller) {
var varianceThreshhold = 1,
smoothInput = config.getOptions().analogStickSmoothing,
outputSmoothing = new Smoothing(smoothInput),
Function outputSmoothing
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
var outputSmoothing = function(smoothInput) {
'use strict';
var buffer = {},
maxFrames = 5;
Function TouchPad
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function TouchPad(controller) {
const touchPad = config.getControllerConfig().touchPad;
let pBuffer = {};
function processIsActive(buffer, tpAxis) {
Function motionProcessor
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
var motionProcessor = function(controller) {
var varianceThreshhold = 1,
smoothInput = config.getOptions().accelerometerSmoothing,
outputSmoothing = new Smoothing(smoothInput),
- 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 setOptions
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
setOptions: function(opts) {
//no options were passed
options = opts || {};
// Defaults:
- 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 Analogs
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
var Analogs = function(controller) {
var varianceThreshhold = 1,
smoothInput = config.getOptions().analogStickSmoothing,
outputSmoothing = new Smoothing(smoothInput),
- 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"