Showing 31 of 31 total issues
Function bindCommands
has 362 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.bindCommands = function bindCommands(forum) {
/**
* Command Handlers
*
* @default
- Create a ticketCreate a ticket
Function bindChat
has 177 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.bindChat = function bindChat(forum) {
/**
* Send a message to the chatroom
*
- Create a ticketCreate a ticket
Function bindTopic
has 173 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.bindTopic = function bindTopic(forum) {
/**
* Topic Class
*
* Represends a forum topic
- Create a ticketCreate a ticket
Function bindNotification
has 172 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.bindNotification = function bindNotification(forum) {
const mentionTester = new RegExp(`(^|\\s)@${forum.username}(\\s|$)`, 'i');
/**
- Create a ticketCreate a ticket
Function bindCommands
has a Cognitive Complexity of 40 (exceeds 5 allowed). Consider refactoring. Open
exports.bindCommands = function bindCommands(forum) {
/**
* Command Handlers
*
* @default
- Read upRead up
- Create a ticketCreate a ticket
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
File commands.js
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/**
* NodeBB provider module User class
* @module sockbot.lib.commands
* @author Accalia
- Create a ticketCreate a ticket
Function bindPost
has 119 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.bindPost = function bindPost(forum) {
/**
* Post Class
*
* Represents a forum post
- Create a ticketCreate a ticket
Function bindCategory
has 114 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.bindCategory = function bindCategory(forum) {
/**
* Topic Processor
*
* @typedef {TopicProcesspr}
- Create a ticketCreate a ticket
Function bindUser
has 86 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.bindUser = function bindUser(forum) {
/**
* User Class
*
* Represents a forum user
- Create a ticketCreate a ticket
File index.js
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
'use strict';
/**
* NodeBB provider module
* @module sockbot.providers.nodebb
* @author Accalia
- Create a ticketCreate a ticket
Forum
has 21 functions (exceeds 20 allowed). Consider refactoring. Open
class Forum extends EventEmitter {
/**
* Get announced compatibilities string for the provider
*/
- Create a ticketCreate a ticket
Function summoner
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function summoner(forum, config) {
let messages = utils.cloneData(defaultMessages);
config = config || {}; // prevent nulls
if (Array.isArray(config) && config.length > 0) {
messages = config;
- Create a ticketCreate a ticket
Function bindNotification
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
exports.bindNotification = function bindNotification(forum) {
const mentionTester = new RegExp(`(^|\\s)@${forum.username}(\\s|$)`, 'i');
/**
- Read upRead up
- Create a ticketCreate a ticket
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 login
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
login() {
const errorify = (err) => {
if (!(err instanceof Error)) {
err = new Error(err);
}
- Create a ticketCreate a ticket
Function mergeHelper
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
function mergeHelper(base, mixin, name, mergeArrays) {
if (Array.isArray(mixin[name])) {
if (!mergeArrays && base[name] && Array.isArray(base[name])) {
base[name] = base[name].concat(mixin[name]);
} else {
- Read upRead up
- Create a ticketCreate a ticket
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 bindChat
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
exports.bindChat = function bindChat(forum) {
/**
* Send a message to the chatroom
*
- Read upRead up
- Create a ticketCreate a ticket
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 getCommandHelps
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
function getCommandHelps() {
const cmds = {},
topics = {},
result = ['Registered commands:'];
let keys = {};
- Create a ticketCreate a ticket
Function notifyHandler
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
function notifyHandler(data) {
const notification = Notification.parse(data);
return evalBlacklist(notification)
.then(() => {
forum.emit('log', `Notification ${notification.id}: ${notification.label} received`);
- Create a ticketCreate a ticket
Function constructor
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(payload) {
payload = utils.parseJSON(payload);
const body = string(payload.bodyLong || '').unescapeHTML().s;
let type = 'notification';
if (/^\[\[\w+:user_posted_to/i.test(payload.bodyShort)) {
- Create a ticketCreate a ticket
Function _getConfig
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
_getConfig() {
this._verifyCookies();
this._config = {};
return new Promise((resolve, reject) => {
debug('begin configuration fetch for CSRF token');
- Create a ticketCreate a ticket