Showing 23 of 29 total issues
Function _areSelectedEqual
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
_areSelectedEqual(selectedValue, moduleValue, isMultiple) {
if (isMultiple) {
// If selectedValue passed in is an array, we are assuming that its the collection getting updated and that
// all module values must equal the attrValues
- 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
BaseMixin
has 24 functions (exceeds 20 allowed). Consider refactoring. Open
Semantic.BaseMixin = Ember.Mixin.create({
/// Internal Variables
_initialized: false,
_bindableAttrs: null,
_settableAttrs: null,
Function _settings
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
_settings() {
let moduleName = this.getSemanticModuleName();
let moduleGlobal = this.getSemanticModuleGlobal();
if (!moduleGlobal) {
- 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 exports
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
module.exports = function(path, property, options) {
for (var i = 0; i < options.length; i++) {
var option = options[i];
if (option == null || typeof option !== "object") {
continue;
- 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 included
has 46 lines of code (exceeds 25 allowed). Consider refactoring. Open
included: function (app) {
// If the addon has the _findHost() method (in ember-cli >= 2.7.0), we'll just
// use that. This helps support ember-engines, where we want to find
// the 'parent' app
if (typeof this._findHost === 'function') {
Function _inspectValueAndCurrent
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
_inspectValueAndCurrent() {
let value = this.get('value');
let current = this.get('current');
// If either are a promise, we need to make sure both are resolved
// Or wait for them to resolve
- 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 included
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
included: function (app) {
// If the addon has the _findHost() method (in ember-cli >= 2.7.0), we'll just
// use that. This helps support ember-engines, where we want to find
// the 'parent' app
if (typeof this._findHost === 'function') {
- 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 setSemanticAttr
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
setSemanticAttr(attrName, attrValue) {
if (attrName === 'content' || attrName === 'title' || attrName === 'html') {
let value = this._unwrapHTMLSafe(attrValue);
let response = this.execute('setting', attrName, value);
if (this.execute('is visible')) {
- 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 _areSelectedEqual
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_areSelectedEqual(selectedValue, moduleValue, isMultiple) {
if (isMultiple) {
// If selectedValue passed in is an array, we are assuming that its the collection getting updated and that
// all module values must equal the attrValues
Function _settings
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
_settings() {
let moduleName = this.getSemanticModuleName();
let moduleGlobal = this.getSemanticModuleGlobal();
if (!moduleGlobal) {
Function setSemanticAttr
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
setSemanticAttr(attrName, attrValue) {
if (attrName === 'content' || attrName === 'title' || attrName === 'html') {
let value = this._unwrapHTMLSafe(attrValue);
let response = this.execute('setting', attrName, value);
if (this.execute('is visible')) {
Function setSemanticAttr
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
setSemanticAttr(attrName, attrValue) {
// Handle checked
if (attrName === 'checked') {
if (attrValue) {
return this.execute('set checked');
- 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 _setCurrentSelected
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
_setCurrentSelected(selectedValue, moduleSelected, isMultiple) {
if (Ember.isBlank(selectedValue)) {
if (!Ember.isBlank(moduleSelected)) {
this.execute('clear');
}
- 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 (this.areAttrValuesEqual('selected', selectedValue, item)) {
return true; // We found a match, just looking for one
}
Avoid deeply nested control flow statements. Open
if (this.areAttrValuesEqual('selected', value, module)) {
equal = true;
break;
}
Avoid too many return
statements within this function. Open
return this.areAttrValuesEqual('selected', selectedValue, moduleValue);
Avoid too many return
statements within this function. Open
return this.execute('set disabled');
Avoid too many return
statements within this function. Open
return true; // We found a match, just looking for one
Avoid too many return
statements within this function. Open
return this.execute('set enabled');
Avoid too many return
statements within this function. Open
return this.$().toggleClass('read-only', attrValue);