Showing 5 of 9 total issues
Function format_any
has a Cognitive Complexity of 141 (exceeds 20 allowed). Consider refactoring. Open
exports.format_any = function (pi_name, r) {
// title: the value shown in the HTML tooltip
// classy: color of the square
switch (pi_name) {
case 'access':
- 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 get_class
has a Cognitive Complexity of 85 (exceeds 20 allowed). Consider refactoring. Open
exports.get_class = function (pi_name, r) {
if (!r.pass) r.pass = []
if (!r.fail) r.fail = []
if (!r.err) r.err = []
- 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 format_any
has 185 lines of code (exceeds 100 allowed). Consider refactoring. Open
exports.format_any = function (pi_name, r) {
// title: the value shown in the HTML tooltip
// classy: color of the square
switch (pi_name) {
case 'access':
Function redis_subscribe_all_results
has 144 lines of code (exceeds 100 allowed). Consider refactoring. Open
exports.redis_subscribe_all_results = async function (next) {
const plugin = this
if (this.pubsub) return // already subscribed?
Function ws_connect
has a Cognitive Complexity of 21 (exceeds 20 allowed). Consider refactoring. Open
function ws_connect() {
if (!window.location.origin) {
window.location.origin = `${window.location.protocol}//${window.location.hostname}`
if (window.location.port)
window.location.origin += `:${window.location.port}`
- 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"