Showing 10 of 72 total issues
Function tabs
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
cb.tabs = function() {
"use strict";
// Stores information relating to tabs
var tabs = {
list: [],
Method Client.Request
has a Cognitive Complexity of 40 (exceeds 20 allowed). Consider refactoring. Open
func (c Client) Request(method string, path string, body []byte) ([]byte, int, error) {
c.Host.Path = path
httpClient := &http.Client{}
req, err := http.NewRequest(method, c.Host.String(), bytes.NewBuffer(body))
- 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 tabs
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
cb.tabs = function() {
"use strict";
// Stores information relating to tabs
var tabs = {
list: [],
- 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 connection
has 74 lines of code (exceeds 25 allowed). Consider refactoring. Open
cb.connection = function() {
"use strict";
var networks = [
{
name: "freenode",
Method Client.Request
has 56 lines of code (exceeds 50 allowed). Consider refactoring. Open
func (c Client) Request(method string, path string, body []byte) ([]byte, int, error) {
c.Host.Path = path
httpClient := &http.Client{}
req, err := http.NewRequest(method, c.Host.String(), bytes.NewBuffer(body))
Function NewUser
has 5 return statements (exceeds 4 allowed). Open
func NewUser(email, password string) (*User, []validate.ValidationMsg, error) {
id, err := generateUUID()
if err != nil {
logger.Error.Print(err)
return &User{}, []validate.ValidationMsg{}, err
Method Client.Request
has 5 return statements (exceeds 4 allowed). Open
func (c Client) Request(method string, path string, body []byte) ([]byte, int, error) {
c.Host.Path = path
httpClient := &http.Client{}
req, err := http.NewRequest(method, c.Host.String(), bytes.NewBuffer(body))
Avoid too many return
statements within this function. Open
return;
Avoid too many return
statements within this function. Open
return;
Function util
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
cb.util = function() {
"use strict";
// Returns the index of an element amongst its siblings in its parent
var indexInParent = function(node) {
var children = node.parentNode.childNodes;
- 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"