Showing 9 of 14 total issues
Function getIM
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
slackAPI.prototype.getIM = function (term) {
var im = null,
self = this;
for (var i in self.slackData.ims) {
if (self.slackData.ims[i].user === term) {
- 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 connectSlack
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
slackAPI.prototype.connectSlack = function (wsurl, cb) {
var self = this;
self.ws = new webSocket(wsurl);
self.ws.on('open', function () {
self.out('transport', 'Connected as ' + self.slackData.self.name + ' [' + self.slackData.self.id + '].');
Function slackAPI
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function slackAPI(args, err_cb) {
err_cb = err_cb || function () {};
var self = this;
var authtoken = args.token;
Function sendPM
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
slackAPI.prototype.sendPM = function (userID, text) {
var self = this;
var channel = self.getIM(userID);
if (channel !== null) {
self.sendSock({
Function getGroup
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
slackAPI.prototype.getGroup = function (term) {
var group = null,
self = this;
for (var i in self.slackData.groups) {
if (self.slackData.groups[i].name === term) {
- 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 getChannel
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
slackAPI.prototype.getChannel = function (term) {
var channel = null,
self = this;
for (var i in self.slackData.channels) {
if (self.slackData.channels[i].name === term) {
- 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 getUser
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
slackAPI.prototype.getUser = function (term) {
var user = null,
self = this;
for (var i in self.slackData.users) {
if (self.slackData.users[i].name === term) {
- 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 getUserByEmail
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
slackAPI.prototype.getUserByEmail = function (term) {
var user = null,
self = this;
for (var i in self.slackData.users) {
if (self.slackData.users[i].profile.email === term) {
- 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 slackAPI
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
function slackAPI(args, err_cb) {
err_cb = err_cb || function () {};
var self = this;
var authtoken = args.token;
- 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"