jhpoelen/eol-globi-js

View on GitHub

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;
Severity: Minor
Found in index.js - About 1 day to fix

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;
Severity: Major
Found in index.js - About 5 hrs to fix

    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');
    
    
    Severity: Minor
    Found in index.js - About 4 hrs to fix

      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') ]
      Severity: Major
      Found in index.js - About 2 hrs to fix

        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'] : [],
        Severity: Minor
        Found in index.js - About 1 hr to fix

          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'] : [],
          Severity: Minor
          Found in index.js - About 55 mins to fix

          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") {
          Severity: Minor
          Found in index.js - About 45 mins to fix

          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

          Severity
          Category
          Status
          Source
          Language