etnbrd/flx-compiler

View on GitHub

Showing 623 of 1,229 total issues

Function worker has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function worker(id, blank, msg) {
  id = '' + id;
  var type = id[0];
  var addr = id.substring(1); //Array.prototype;
  msg = msg ? JSON.parse(msg) : undefined;
Severity: Minor
Found in prototypes/zeromq/src/old/worker.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 inspect has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function inspect() {

  var that = this;

  if (Object.prototype.toString.call(this) === "[object Array]") {
Severity: Minor
Found in prototypes/blender/lib/graphviz.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 state_machine has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

var state_machine = function(cb){
  switch(state){
    case 1: {
      if (state_cpt >= LENGTH-3) {
        state = 2;
Severity: Minor
Found in prototypes/fluxions/bench/distribution/setTimeout.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