providers/nodebb/index.js
File index.js
has 273 lines of code (exceeds 250 allowed). Consider refactoring. Open
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
Open
class Forum extends EventEmitter {
/**
* Get announced compatibilities string for the provider
*/
- Create a ticketCreate a ticket
Function login
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
login() {
const errorify = (err) => {
if (!(err instanceof Error)) {
err = new Error(err);
}
- Create a ticketCreate a ticket
Function _getConfig
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
_getConfig() {
this._verifyCookies();
this._config = {};
return new Promise((resolve, reject) => {
debug('begin configuration fetch for CSRF token');
- Create a ticketCreate a ticket
Function _emitWithRetry
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
Open
_emitWithRetry(delay) {
let trials = 5;
const args = Array.prototype.slice.call(arguments);
args.shift(); // remove the delay parameter
const fn = () => new Promise((resolve, reject) => {
- 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"