AndrewRevinsky/crunchtask.js

View on GitHub

Showing 15 of 21 total issues

Function encapsulateRunInstance has a Cognitive Complexity of 45 (exceeds 5 allowed). Consider refactoring.
Open

function encapsulateRunInstance(instanceApi, taskEvents, resolveReject, promise) {

  var ctx = this, // jshint ignore:line
    thisTask = ctx.task,
    parentTask = ctx.parentTask,
Severity: Minor
Found in lib/ctRunEncapsulateInst.js - About 6 hrs 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 encapsulateRunInstance has 155 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function encapsulateRunInstance(instanceApi, taskEvents, resolveReject, promise) {

  var ctx = this, // jshint ignore:line
    thisTask = ctx.task,
    parentTask = ctx.parentTask,
Severity: Major
Found in lib/ctRunEncapsulateInst.js - About 6 hrs to fix

Function proceedDescriptionFn has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
Open

function proceedDescriptionFn(instanceApi) {

  var ctx = this, // jshint ignore:line
    thisTask = ctx.task,
    descriptionFn = ctx.descriptionFn;
Severity: Minor
Found in lib/ctFnProceedDescription.js - About 2 hrs 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 proceedBodyFn has 59 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function proceedBodyFn(instanceApi, isFirstTime) {
  if (config.trace) {

    console.log('inside proceedBodyFn', this.id, new Date() - 0); // jshint ignore:line
    console.log('isFirstTime', isFirstTime);
Severity: Major
Found in lib/ctFnProceedBody.js - About 2 hrs to fix

Function translateRangeSet has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

function translateRangeSet(rangeSet) {
  var rangeLength = rangeSet.length,
    last = rangeLength - 1,
    lastIsBool = type.isBoolean(rangeSet[last]),
    step;
Severity: Minor
Found in lib/typeRange.js - About 2 hrs 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 proceedDescriptionFn has 46 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function proceedDescriptionFn(instanceApi) {

  var ctx = this, // jshint ignore:line
    thisTask = ctx.task,
    descriptionFn = ctx.descriptionFn;
Severity: Minor
Found in lib/ctFnProceedDescription.js - About 1 hr to fix

Function parseRangeArgs has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function parseRangeArgs(args, preventRecursion) {
  var result = [],
    current = [],
    item,
    isArrayFlag;
Severity: Minor
Found in lib/typeRange.js - About 1 hr 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 canAdvance has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

Range.prototype.canAdvance = function canAdvance(justCheck) {
  var currentR = 0,
    ranges = this.data,
    maxR = ranges.length,
    range,
Severity: Minor
Found in lib/typeRange.js - About 1 hr 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 staticReduce has 31 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function staticReduce(arr, memo, taskBody, taskTail) {

  return new CrunchTask(function (init, body, fin) {

    var ranges,
Severity: Minor
Found in lib/ctStaticReduce.js - About 1 hr to fix

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

function protoRun(descriptionFn, taskEvents) {
  var thisTask = this; // jshint ignore:line
  var parentTask = globals.staticParentTask;
  globals.staticParentTask = null;

Severity: Minor
Found in lib/ctProtoRun.js - About 1 hr to fix

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

function translateRangeSet(rangeSet) {
  var rangeLength = rangeSet.length,
    last = rangeLength - 1,
    lastIsBool = type.isBoolean(rangeSet[last]),
    step;
Severity: Minor
Found in lib/typeRange.js - About 1 hr to fix

Function staticForEach has 27 lines of code (exceeds 25 allowed). Consider refactoring.
Open

function staticForEach(arr, taskBody, taskTail) {

  return new CrunchTask(function (init, body, fin) {
    var ranges,
      ptr,
Severity: Minor
Found in lib/ctStaticForEach.js - About 1 hr to fix

Function _trigger has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function _trigger(hive, evt /*, args*/) {
  var args1 = __slice.call(arguments, 2);
  if (!hive[evt]) {
    return;
  }
Severity: Minor
Found in lib/events.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 _fnBindAll has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function _fnBindAll(ctx, target, source) {
  var method;

  for (var prop in source) {
    //noinspection JSUnfilteredForInLoop
Severity: Minor
Found in lib/bindAll.js - About 25 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 _config has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  config: function _config(obj) {
    if (!type.isObject(obj)) {
      return _config(defaultConfig);
    }
    var result = {};
Severity: Minor
Found in lib/typeCrunchtaskStatics.js - About 25 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