Showing 89 of 875 total issues
Function processLinks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
processLinks(content, force = false) {
// reset the skipped embeds if the content is empty (this will be from a deletion)
if (isEmpty(content) || (isPresent(this.get('fileQueue.files')) || this.get('upload'))) {
this.set('skippedEmbeds', []);
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 toggleTether
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
toggleTether() {
if (!this._onBodyClick) {
scheduleOnce('afterRender', () => {
this._onBodyClick = ({ target }) => {
const elementId = get(this, 'guid');
- 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 transitionTo
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
transitionTo(item) {
invokeAction(this, 'close');
if (typeOf(item) === 'string') {
get(this, 'router').transitionTo(item);
} else {
- 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 loginWithFacebook
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
loginWithFacebook: task(function* () {
try {
yield get(this, 'session').authenticateWithFacebook();
yield get(this, 'gotoNext').perform();
} catch (error) {
- 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 processLinks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
processLinks(content, force = false) {
// reset the skipped embeds if the content is empty (this will be from a deletion)
if (isEmpty(content) || (!this.get('queueFinished') || this.get('uploads.length') > 0)) {
this.set('skippedEmbeds', []);
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 normStats
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
normStats: computed('user.stats', function() {
const stats = get(this, 'user.stats');
const normed = stats.reduce((acc, stat) => {
const camelKind = camelize(get(stat, 'kind'));
return { ...acc, [camelKind]: stat };
- 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 didReceiveAttrs
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
didReceiveAttrs() {
this._super(...arguments);
// display single comment and its thread or load the comments for the post
if (get(this, 'comment') !== undefined) {
- 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 momentLocale
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export default function momentLocale(localeInput = 'en') {
let locale = localeInput;
// Fix for Acadian not having a unique language code
if (locale === 'mis-ca') locale = 'fr-ca';
- 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 updateLibraryEntry
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
updateLibraryEntry: task(function* (force = false) {
set(this, 'didUndo', false);
if (get(this, 'session.hasUser')) {
const entry = yield get(this, 'getLibraryEntry').perform();
- 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"