Showing 165 of 254 total issues
Function Profile
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
const Profile: FunctionComponent = () => {
const toast = useToast();
const { profileStore, userStore } = useContext(ServerContext);
const [name, setName] = useState<string>('');
const [email, setEmail] = useState<string>('');
- 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 handlePrivmsg
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
async function handlePrivmsg(user, msg, command) {
// :ilkkao!~ilkkao@127.0.0.1 NOTICE buppe :foo
const target = msg.params[0];
const currentNick = await nicksService.getNick(user.gId, msg.network);
let conversation;
- 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 init
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
init(args) {
this._super(args);
const message = this.message;
Function log
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
log({ level, message, ...meta }, callback) {
const [, processName, processExtension] = process.title.split('-');
let processColumn;
let cat;
Function exports
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(defaults) {
const app = new EmberApp(defaults, {
sourcemaps: {
enabled: true
},
Function constructor
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor({ gid, body, doc, category, timestamp, updatedTimestamp, user, window, status }: MessageModelProps) {
this.gid = gid;
this.body = body || '';
this.doc = doc;
this.category = category;
Function Search
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Search: FunctionComponent = () => {
const navigate = useNavigate();
const toast = useToast();
const { windowStore } = useContext(ServerContext);
const [name, setName] = useState<string>('');
Function _drawCursor
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
_drawCursor(cursor) {
if (cursor.x === null) {
$('#window-cursor').hide();
return;
}
Function Search
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const Search: FunctionComponent = () => {
const navigate = useNavigate();
const toast = useToast();
const { windowStore } = useContext(ServerContext);
const [name, setName] = useState<string>('');
Function createExt
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
exports.createExt = async function createExt(ctx) {
const form = await decodeForm(ctx.req, registrationFormExt);
async function renderForm() {
await ctx.render('register-ext', {
Function init
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
init(args) {
this._super(args);
this.content = EmberObject.create();
Function handleSendText
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
handleSendText({ window = mandatory(), text = mandatory() }) {
let sent = false;
setTimeout(() => {
if (!sent) {
Function _layoutWindows
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
_layoutWindows(animate) {
const duration = animate ? 600 : 0;
const windowComponents = this.windowComponents;
const container = this._containerDimensions();
const expandedWindow = windowComponents.findBy('expanded', true);
Function _lineAdded
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
_lineAdded(message) {
if (!message || !windowStore.initDone) {
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 setters
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
static get setters() {
return {
name: function name(realName) {
if (!realName || realName.length < 6) {
return { valid: false, error: 'Please enter at least 6 characters.' };
- 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 _lineAdded
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_lineAdded(message) {
if (!message || !windowStore.initDone) {
return;
}
Function setupTransporter
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
function setupTransporter() {
if (get('mailgun:enabled')) {
const mailgun = require('nodemailer-mailgun-transport'); // Slow module to require
const mailgunAuth = {
auth: {
Function renderMessage
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
const renderMessage = () => {
const color = message.isFromMe ? 'blue.600' : undefined;
const nickColor = message.isFromMe ? 'blue.600' : '#617eb5';
if (editedBody) {
Function constructor
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(rootStore: RootStore, socket: Socket) {
this.rootStore = rootStore;
this.socket = socket;
makeObservable(this, {
Function createInputRules
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
createInputRules(): InputRule[] {
const getUniCodeEmoji = (text: string) => {
const emojis = emojiIndex.search(text.replace(/^:(.+):$/, (_match, name) => name));
if (!emojis || emojis.length === 0) {