Showing 6 of 18 total issues
File SlackRelay.js
has 255 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
'use strict';
/**
* Stand for a bot user
* in charge of carrying messages from a locally confugured bot to slack
Function connect
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
connect() {
let connectionTimeout;
let _rtm = rtm.get(this);
let token = token_private.get(this);
let slackRelayInstance = this;
Function initialize
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
initialize(token) {
// web
let slackRelayInstance = this;
let _rtm = rtm.get(this);
Function initialize
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
Open
initialize(token) {
// web
let slackRelayInstance = this;
let _rtm = rtm.get(this);
- 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 promisedResponse
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
let promisedResponse = new Promise(function(resolve, reject) {
// @DONE make sure bot is not already connected
// if so then just return this instance
if (_rtm.connected) {
resolve(slackRelayInstance);
Function _intializeSlackListener
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_intializeSlackListener() {
let _rtm = rtm.get(this);
let self = this;
_rtm.on(RTM_EVENTS.MESSAGE, function handleRtmMessage(message) {