Showing 20 of 35 total issues
Function work
has 107 lines of code (exceeds 25 allowed). Consider refactoring. Open
work: function(my) {
my.keyboard.on("right", my.drone.rightFlip);
my.keyboard.on("left", my.drone.leftFlip);
my.keyboard.on("up", my.drone.frontFlip);
my.keyboard.on("down", my.drone.backFlip);
Function extend
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
function extend(base, source) {
var isArray = Array.isArray(source);
if (base == null) {
base = isArray ? [] : {};
- 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 Robot
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
var Robot = module.exports = function Robot(opts) {
Utils.classCallCheck(this, Robot);
opts = opts || {};
Function Robot
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
var Robot = module.exports = function Robot(opts) {
Utils.classCallCheck(this, Robot);
opts = opts || {};
- 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 work
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
work: function(my) {
my.keyboard.on("right", my.drone.rightFlip);
my.keyboard.on("left", my.drone.leftFlip);
my.keyboard.on("up", my.drone.frontFlip);
my.keyboard.on("down", my.drone.backFlip);
- 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 work
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
work: function(my) {
var max = 0;
var changingColor = false;
my.sphero.setDataStreaming(["velocity"], { n: 40, m: 1, pcnt: 0 });
Function install
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports.install = function() {
/**
* Multiplies a number by 60000 to convert minutes
* to milliseconds
*
Function Initializer
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function Initializer(type, opts) {
var mod;
mod = Registry.findBy(type, opts[type]);
Function start
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
Robot.prototype.start = function(callback) {
if (this.running) {
return this;
}
Function create
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
api.create = function create(Server, opts) {
// if only passed options (or nothing), assume HTTP server
if (Server == null || _.isObject(Server) && !_.isFunction(Server)) {
opts = Server;
Server = "http";
- 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 reduce
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function reduce(collection, iteratee, accumulator, thisVal) {
var isArray = H.isArray(collection);
if (!isArray && !H.isObjectLoose(collection)) {
return null;
- 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 extend
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
function extend(base, source) {
var isArray = Array.isArray(source);
if (base == null) {
base = isArray ? [] : {};
Function register
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
register: function(module) {
if (this.data[module]) {
return this.data[module].module;
}
Function parallel
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function parallel(functions, done) {
var total = functions.length,
completed = 0,
results = [],
error;
- 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 register
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
register: function(module) {
if (this.data[module]) {
return this.data[module].module;
}
- 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 install
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
module.exports.install = function() {
/**
* Multiplies a number by 60000 to convert minutes
* to milliseconds
*
- 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 device
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Robot.prototype.device = function(name, device) {
var str;
device.robot = this;
device.name = name;
- 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 search
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
search: function(entry, value) {
for (var name in this.data) {
if (this.data.hasOwnProperty(name)) {
var repo = this.data[name];
- 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 series
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function series(functions, done) {
var results = [],
error;
if (typeof done !== "function") { done = function() {}; }
- 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 Initializer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function Initializer(type, opts) {
var mod;
mod = Registry.findBy(type, opts[type]);
- 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"