File main.js
has 487 lines of code (exceeds 250 allowed). Consider refactoring. Open
/* eslint-env browser, commonjs */
'use strict';
const $ = require('../../../node_modules/jquery/dist/jquery.slim.min.js');
const IO = require('../../../node_modules/socket.io-client/dist/socket.io.slim.js');
Function response
has a Cognitive Complexity of 39 (exceeds 5 allowed). Consider refactoring. Open
response(type, err, data) {
if (err) return popup('ERROR!');
if (type === 'response') {
if (data.type === 'set') {
- 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 constructor
has 115 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor() {
const sendEventListeners = [
// API buttons
Function constructor
has 59 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor() {
super();
this.connect();
Function update
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
update(data) {
if (data.remove) return $(`#${data.remove}`).remove();
for (let el of data) {
- 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 response
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
response(type, err, data) {
if (err) return popup('ERROR!');
if (type === 'response') {
if (data.type === 'set') {
Function addEventListener
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
addEventListener(obj) {
const resolve = path => {
let obj = window;
- 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 addEventListener
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
addEventListener(obj) {
const resolve = path => {
let obj = window;
Function update
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
update(data) {
if (data.remove) return $(`#${data.remove}`).remove();
for (let el of data) {
Function select
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
select(type) {
let types = this.filter.types,
id;
- 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 constructor
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor() {
this.filter = {
all: '#feed-all',
types: [
Avoid deeply nested control flow statements. Open
if (i === props.length) {
obj[prop] = value;
} else {
obj = obj[prop];
i = i + 1;
Avoid deeply nested control flow statements. Open
if (el === selected) {
$('#template > div > select').append(
`<option value="${el}" selected>${el}</option>`
);
Function compare
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
compare(data) {
if (data.remove) return this.update(data);
let arr = [],
- 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 request
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
request(type, obj) {
if (socket.connected) {
if (obj.value === true || obj.value === false) {
if (obj.value) {
- 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
Definition for rule 'semi-style' was not found Open
'use strict';
- Read upRead up
- Exclude checks
For more information visit Source: http://eslint.org/docs/rules/