Showing 18 of 21 total issues
Function checkPosition
has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring. Open
checkPosition() {
const elem = this.$().offsetParent();
let menuHeightTop = elem.height() - (elem.height() - (this.$().offset().top - elem.offset().top)) - 20; // height of the container minus the the bottom space from the top of the button.
let menuHeightBot = elem.height() - ((this.$().offset().top + this.$().height()) - elem.offset().top) - 20; // height of the container minus the bottom of the select button.
- 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 didRender
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
didRender() {
this._super();
if (!get(this, 'firstRender')) {
set(this, 'firstRender', true);
- 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 openTab
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
openTab(tab) {
if (this.$().length > 0) {
// hide all other tabs
get(this, 'model').forEach(item => item.hideTab());
- 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 sortableObject
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
export default function sortableObject(meta) {
// get header if it was provided
let header = get(meta, 'header');
if (isNone(header)) {
header = '';
- 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 typeCast
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
function typeCast(value) {
if (/^[.][\d]+/.test(value)) {
return typeCast(0 + value);
}
- 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 buildTabData
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
buildTabData() {
assert('buildTabData must be called after render', this.$().length > 0);
let model = [];
this.$(TAB_CONTENT).children().each((index, el) => {
Function sortableObject
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function sortableObject(meta) {
// get header if it was provided
let header = get(meta, 'header');
if (isNone(header)) {
header = '';
Function renderTemplates
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
renderTemplates: function() {
const list = this.$();
if (list && list.find) {
const row = list.find('section').children('.content-row').first();
if (row.length > 0) {
Function createModelContainer
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
function createModelContainer(target, model, metaData) {
assert('model is required for createModelContainer', !isNone(model) && typeof model === 'object');
assert('metaData is required for createModelContainer', !isEmpty(metaData) && Array.isArray(metaData));
// create container
- 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
Avoid deeply nested control flow statements. Open
if (get(oldOpt, key) !== get(option, key)) {
hasChanges = true;
}
Function open
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
open() {
if (!get(this, 'isDestroyed')) {
this.bindEscape();
this.bindClick();
- 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 setListener
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
function setListener(type, namespace, listener, capture=false, passive=false) {
Function bind
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
export function bind(target, type, namespace, listener, { capture=false, rebind=false, passive=false, once=false }) {
Function addQueryStringPair
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function addQueryStringPair(params, key, value) {
if (/\[.+\]/.test(key)) { // parse type: `key[subkey]=value`
let [ normalizeKey, subKey ] = key.split('[');
subKey = subKey.split(']').join('');
let obj = get(params, normalizeKey) || {};
- 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
Avoid too many return
statements within this function. Open
return val;
Avoid too many return
statements within this function. Open
return value;
Avoid too many return
statements within this function. Open
return val;
Function click
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
click(evt) {
if (!get(this, 'disabled')) {
if (!get(this, 'bubbles')) {
evt.stopPropagation();
}
- 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"