Showing 37 of 112 total issues
Function onMessage
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
onMessage: function (bot, user, userID, channelID, message, rawEvent) {
const imgParts = message.split('"')
const memeType = imgParts[0].split(' ')[1]
const memeList = {
'10guy': 101440,
Function setupBot
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
const setupBot = function () {
bot.on('ready', function (data) {
// First wins if none is defined
if (!bot.DISCORD_GUILD) bot.DISCORD_GUILD = data.d.guilds[0].id
// Allow usage of text name or 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 onMessage
has 49 lines of code (exceeds 25 allowed). Consider refactoring. Open
onMessage: function (bot, user, userID, channelID, message, rawEvent) {
var parts = message.split(' ')
parts.splice(0, 2)
var verb = parts.splice(0, 1).join()
if (verb === 'at') {
Function initialize
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const initialize = function () {
glob('_build/modules/*.js', function (err, files) {
// Bail out if the modules directory doesn't exist. Your install is fucked?
if (err) throw new Error(err)
for (let i = 0; i < files.length; i++) {
- 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 onMessage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
onMessage: function (bot, user, userID, channelID, message, rawEvent) {
var parts = message.split(' ')
parts.splice(0, 2)
var verb = parts.splice(0, 1).join()
if (verb === 'at') {
- 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 onMessage
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
onMessage: function (bot, user, userID, channelID, message, rawEvent, {random}) {
const rollMatches = search => {
return regex`
(
(?<numDice> \d{0,4})
- 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 onMessage
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onMessage = function (user, userID, channelID, message, rawEvent) {
if (message.indexOf('!bots?') > -1 && message.indexOf('Force all bots to identify themselves') === -1) {
return bot.sendMessage({
to: channelID,
message: 'Hello I am a robot and my name is ' + bot.BOT_NAME
Function setupBot
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
const setupBot = function () {
bot.on('ready', function (data) {
// First wins if none is defined
if (!bot.DISCORD_GUILD) bot.DISCORD_GUILD = data.d.guilds[0].id
// Allow usage of text name or id
Function onMessage
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const onMessage = function (user, userID, channelID, message, rawEvent) {
if (message.indexOf('!bots?') > -1 && message.indexOf('Force all bots to identify themselves') === -1) {
return bot.sendMessage({
to: channelID,
message: 'Hello I am a robot and my name is ' + bot.BOT_NAME
- 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 onReady
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const onReady = function () {
// Cron Jobby bit
schedule.scheduleJob('announceGuard', '*/5 * * * *', function () {
announceGuard = 0
})
Function onMessage
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
onMessage: function (bot, user, userID, channelID, message, rawEvent, {random}) {
Function onMessage
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
onMessage: function (bot, user, userID, channelID, message, rawEvent, {random}) {
Function onMessage
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
onMessage: function (bot, user, userID, channelID, message, rawEvent, {random}) {
Function onMessage
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
onMessage: function (bot, user, userID, channelID, message, rawEvent, {random}) {
Function onMessage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
onMessage: function (bot, user, userID, channelID, message, rawEvent) {
Function onMessage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
onMessage: function (bot, user, userID, channelID, message, rawEvent) {
Function onMessage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
onMessage: function (bot, user, userID, channelID, message, rawEvent) {
Function onMessage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
onMessage: function (bot, user, userID, channelID, message, rawEvent) {
Function onMessage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
onMessage: function (bot, user, userID, channelID, message, rawEvent) {
Function onMessage
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
onMessage: function (bot, user, userID, channelID, message, rawEvent) {