hummingbird-me/kitsu-web

View on GitHub

Showing 88 of 872 total issues

Function getCurrentUser has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  async getCurrentUser() {
    const { store, raven } = getProperties(this, 'store', 'raven');
    try {
      // Load the current user
      const users = await store.query('user', {
Severity: Minor
Found in app/services/session.js - About 25 mins to fix

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) {
Severity: Minor
Found in app/components/stream-feed/items/post/comments.js - About 25 mins to fix

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 queryParamsDidChange has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  queryParamsDidChange({ shouldRefresh, changed }) {
    // save to cache
    if (get(this, 'session').isCurrentUser(get(this, 'user'))) {
      const cache = get(this, 'cache');
      if ('media' in changed) {
Severity: Minor
Found in app/controllers/users/library.js - About 25 mins to fix

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) || (isPresent(this.get('fileQueue.files')) || this.get('upload'))) {
        this.set('skippedEmbeds', []);
        return;
Severity: Minor
Found in app/components/stream-feed/items/post/comment-box.js - About 25 mins to fix

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';

Severity: Minor
Found in app/utils/languages-moment.js - About 25 mins to fix

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 unitText has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  unitText: computed('isCompleted', 'entry.{progress,unit}', function() {
    // Completed?
    if (get(this, 'isCompleted')) {
      return get(this, 'intl').t('dashboard.quick-update.media.complete');
    }
Severity: Minor
Found in app/components/dashboard/quick-update/item.js - About 25 mins to fix

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 {
Severity: Minor
Found in app/components/search-results/group.js - About 25 mins to fix

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;
Severity: Minor
Found in app/components/stream-feed/create-post.js - About 25 mins to fix

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

Severity
Category
Status
Source
Language