Showing 165 of 254 total issues
Function handle376or422
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function handle376or422(user, msg) {
const networkInfo = await findOrCreateNetworkInfo(user, msg.network);
await addSystemMessage(user, msg.network, 'server', msg.params.join(' '));
Function exports
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function (environment) {
const ENV = {
modulePrefix: 'mas',
podModulePrefix: 'mas/pods',
environment,
Function handleSet
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function handleSet({ user, command }) {
const properties = command.settings || {};
const keys = Object.keys(properties);
if (keys.length === 0) {
- 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 authLocal
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
async function authLocal(username, password, done) {
if (!username) {
return;
}
- 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 runSetters
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function runSetters(objectProps, setters) {
const preparedProps = {};
const errors = {};
for (const prop of Object.keys(objectProps)) {
- 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 handleAddMessageServer
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
handleAddMessageServer({
gid = mandatory(),
userId = mandatory(),
ts = mandatory(),
windowId = mandatory(),
- 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 externalLogin
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
exports.externalLogin = function externalLogin(provider) {
return async ctx => {
await passport.authenticate(provider, async (err, user, info) => {
if (user) {
await createAuthSession(ctx, user);
- 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 authLocal
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
async function authLocal(username, password, done) {
if (!username) {
return;
}
Function handleUploadFiles
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleUploadFiles({ files = mandatory(), window = mandatory() }) {
if (files.length === 0) {
return;
}
Function addWindow
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
addWindow(windowRecord: WindowRecord): void {
const window = this.windows.get(windowRecord.windowId);
const user = windowRecord.userId ? this.rootStore.userStore.users.get(windowRecord.userId) || undefined : undefined;
if (window) {
Function handleAddMessagesServer
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleAddMessagesServer({ messages = mandatory() }) {
messages.forEach(({ windowId, messages: windowMessages }) => {
const window = this.windows.get(windowId);
let newMessages;
Function index
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = async function index(ctx) {
ctx.set('Cache-control', 'private, max-age=0, no-cache');
const user = ctx.mas.user;
Function handleAddMessageServer
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleAddMessageServer({
gid = mandatory(),
userId = mandatory(),
ts = mandatory(),
windowId = mandatory(),
Function createHTTPServers
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
function createHTTPServers() {
let httpServer;
let httpsServer;
const httpPort = conf.get('frontend:http_port');
const httpsPort = conf.get('frontend:https_port');
Consider simplifying this complex logical expression. Open
if (cursor.section === 'top' || cursor.section === 'bottom') {
deltaY = rowIndex > cursor.y || (rowIndex === cursor.y && cursor.section === 'top') ? 1 : 0;
} else {
deltaX =
rowIndex === cursor.y && (columnIndex > cursor.x || (columnIndex === cursor.x && cursor.section === 'left'))
Function log
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
log({ level, message, ...meta }, callback) {
const [, processName, processExtension] = process.title.split('-');
let processColumn;
let cat;
- 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 create
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
static create(params) {
if (!params) {
return null;
}
- 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 handleJoin
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
async function handleJoin(user, msg) {
// :neo!i=ilkkao@iao.iki.fi JOIN :#testi4
const channel = msg.params[0];
const network = msg.network;
const targetUser = await nicksService.getUser(msg.nick, network);
- 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 handleProcessLine
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
handleProcessLine({ window = mandatory(), body = mandatory() }) {
let command = false;
let commandParams;
if (body.charAt(0) === '/') {
- 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 disconnectIfIdle
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
async function disconnectIfIdle(user, network) {
const windows = await windowsService.getWindowsForNetwork(user, network);
let onlyServer1on1Left = false;
if (windows.length === 1) {
- 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"