voxgig/seneca-monitor

View on GitHub

Showing 3 of 22 total issues

Function build_view has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
Open

function build_view(opts) {
/*
  return {
    nodes:[],
    links:[]
Severity: Minor
Found in www/app.js - About 3 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 merge_graph has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
Open

function merge_graph(fresh,base) {
  var changed = false

  function link_eq(bl,fl) { 
    return (bl.source === fl.source || bl.source.id === fl.source) && 
Severity: Minor
Found in www/app.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 make_collector has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

function make_collector(spec) {
  if (!spec.ds) return

  spec.ds.on('message', function (data) {
    update(data.toString().split('~'))
Severity: Minor
Found in monitor.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

Severity
Category
Status
Source
Language