Showing 7 of 7 total issues
Function Callbacks
has a Cognitive Complexity of 72 (exceeds 5 allowed). Consider refactoring. Open
globi.Callbacks = function (options) {
function createOptions(options) {
var object = {}, names = options.split(' ');
for (var i = 0, name; name = names[i]; i++) {
object[name] = true;
- 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 Callbacks
has 127 lines of code (exceeds 25 allowed). Consider refactoring. Open
globi.Callbacks = function (options) {
function createOptions(options) {
var object = {}, names = options.split(' ');
for (var i = 0, name; name = names[i]; i++) {
object[name] = true;
File index.js
has 356 lines of code (exceeds 250 allowed). Consider refactoring. Open
var globiData = require('globi-data');
var EventEmitter = require('events').EventEmitter;
var jQuery = require('jquery');
var taxaprisma = require('taxaprisma');
Function Deferred
has 62 lines of code (exceeds 25 allowed). Consider refactoring. Open
globi.Deferred = function (func) {
var tuples = [
[ 'resolve', 'done', globi.Callbacks('once memory'), 'resolved' ],
[ 'reject', 'fail', globi.Callbacks('once memory'), 'rejected' ],
[ 'notify', 'progress', globi.Callbacks('memory') ]
Function ResponseMapper
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
globi.ResponseMapper = function () {
var rawData = arguments.length === 1 ? arguments[0] : {},
isArray = Array.isArray(rawData),
rowNames = rawData['columns'] ? rawData['columns'] : [],
data = rawData['data'] ? rawData['data'] : [],
Function ResponseMapper
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
globi.ResponseMapper = function () {
var rawData = arguments.length === 1 ? arguments[0] : {},
isArray = Array.isArray(rawData),
rowNames = rawData['columns'] ? rawData['columns'] : [],
data = rawData['data'] ? rawData['data'] : [],
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
globi.extend = function (target, source) {
for (var k in source) {
if (source.hasOwnProperty(k)) {
var value = source[k];
if (target.hasOwnProperty(k) && typeof target[k] === "object" && typeof value === "object") {
- 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"