File component.js
has 480 lines of code (exceeds 250 allowed). Consider refactoring. Open
//
// Copyright 2009-2014 Ilkka Oksanen <iao@iki.fi>
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
`` has 27 functions (exceeds 20 allowed). Consider refactoring. Open
export default Component.extend({
init(args) {
this._super(args);
this.content = EmberObject.create();
Function didInsertElement
has 65 lines of code (exceeds 25 allowed). Consider refactoring. Open
didInsertElement() {
this.sendAction('register', this);
this.set('elementInserted', true);
this.$messagePanel = this.$('.window-messages');
Function init
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
init(args) {
this._super(args);
this.content = EmberObject.create();
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 _lineAdded
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
_lineAdded(message) {
if (!message || !windowStore.initDone) {
return;
}
Function _goToBottom
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_goToBottom(animate, callback) {
if (this.scrollLock || !this.$messagesEndAnchor) {
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 _addScrollHandler
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
_addScrollHandler() {
const handler = function () {
if (this.animating) {
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 didInsertElement
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
didInsertElement() {
this.sendAction('register', this);
this.set('elementInserted', true);
this.$messagePanel = this.$('.window-messages');
- 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"