Showing 31 of 31 total issues
Function quoteText
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
exports.quoteText = function quoteText(text, quotedUser, contextUrl, contextTitle) { const quote = stringify(text), user = stringify(quotedUser), url = stringify(contextUrl), title = stringify(contextTitle);
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
lock() { return forum._emit('topics.lock', { tids: [this.id], cid: this.categoryId })
- Read upRead up
- Create a ticketCreate a ticket
Similar blocks of code found in 2 locations. Consider refactoring. Open
unlock() { return forum._emit('topics.unlock', { tids: [this.id], cid: this.categoryId })
- Read upRead up
- Create a ticketCreate a ticket
Function threeParts
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
function threeParts(before, item1, defaultItem1, middle, item2, after) {
- Create a ticketCreate a ticket
Function validateConfig
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
exports.validateConfig = function validateConfig(config) { const errors = []; const checkSection = (key) => { if (typeof config[key] !== 'object') { errors.push(`Missing configuration section: ${key}`);
- Read upRead up
- Create a ticketCreate a ticket
Function getVersion
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
exports.getVersion = function getVersion() { if (packageInfo.version !== '0.0.0-semantic-release') { return packageInfo.version; } const parser = /\$Id: (\S+) \$/;
- Read upRead up
- Create a ticketCreate a ticket
Function relativeRequire
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.relativeRequire = function relativeRequire(relativePath, module, requireIt) { let resolved = `${__dirname}/../${relativePath}/${module}`; if (module.startsWith('/') || module.startsWith('./') || module.startsWith('../')) { resolved = path.posix.resolve(config.basePath, module); }
- Read upRead up
- Create a ticketCreate a ticket
Function bindPost
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.bindPost = function bindPost(forum) { /** * Post Class * * Represents a forum post
- Read upRead up
- Create a ticketCreate a ticket
Function load
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.load = function load(filePath) { return readYaml(filePath) .then((data) => { if (!data) { throw new Error('Invalid Configuration File.');
- Read upRead up
- Create a ticketCreate a ticket
Function _emitWithRetry
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. 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
Function parseJSON
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
exports.parseJSON = function parseJSON(json) { if (!json) { throw new Error('[[invalid-argument:required]]'); } if (typeof json === 'string') {
- Read upRead up
- Create a ticketCreate a ticket