hummingbird-me/kitsu-web

View on GitHub

Showing 872 of 872 total issues

Identical blocks of code found in 2 locations. Consider refactoring.
Open

  _getRatingGroup(rating) {
    if (rating > 0 && rating < 4) {
      return 'awful';
    }

Severity: Major
Found in app/components/library-entry/readonly-rating.js and 1 other location - About 2 hrs to fix
app/models/library-entry.js on lines 56..69

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 78.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  trackImpression(data) {
    const router = get(this.this, 'router');
    if (canUseDOM && get(this, 'hasUser')) {
      const options = { location: get(router, 'currentRouteName'), ...data };
      get(this, 'client').trackImpression(options);
Severity: Major
Found in app/metrics-adapters/stream.js and 1 other location - About 2 hrs to fix
app/metrics-adapters/stream.js on lines 42..48

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 78.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Similar blocks of code found in 2 locations. Consider refactoring.
Open

  trackEngagement(data) {
    const router = get(this.this, 'router');
    if (canUseDOM && get(this, 'hasUser')) {
      const options = { location: get(router, 'currentRouteName'), ...data };
      get(this, 'client').trackEngagement(options);
Severity: Major
Found in app/metrics-adapters/stream.js and 1 other location - About 2 hrs to fix
app/metrics-adapters/stream.js on lines 34..40

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 78.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function exports has 53 lines of code (exceeds 25 allowed). Consider refactoring.
Open

module.exports = function() {
  return {
    name: 'Kitsu',
    short_name: 'Kitsu',
    lang: 'en-US',
Severity: Major
Found in config/manifest.js - About 2 hrs to fix

    File countries.js has 252 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    export default {
      BD: 'Bangladesh',
      BE: 'Belgium',
      BF: 'Burkina Faso',
      BG: 'Bulgaria',
    Severity: Minor
    Found in app/utils/countries.js - About 2 hrs to fix

      Function thumbSize has 50 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const thumbSize = (length, orientation, index) => {
        const max = 538;
        const margin = 4;
        if (orientation === 'square') {
          const box = (max - 4) / 2;
      Severity: Minor
      Found in app/components/stream-feed/items/post/uploads-grid.js - About 2 hrs to fix

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            response.data.forEach(data => {
              const normalize = get(this, 'store').normalize(type, data);
              const record = get(this, 'store').push(normalize);
              records.addObject(record);
            });
        Severity: Major
        Found in app/components/explore/explore-section.js and 1 other location - About 2 hrs to fix
        app/components/explore/explore-more.js on lines 53..57

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 75.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            response.data.forEach(data => {
              const normalize = get(this, 'store').normalize(type, data);
              const record = get(this, 'store').push(normalize);
              records.addObject(record);
            });
        Severity: Major
        Found in app/components/explore/explore-more.js and 1 other location - About 2 hrs to fix
        app/components/explore/explore-section.js on lines 57..61

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 75.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          removeMemberTask: task(function* () {
            yield get(this, 'member').destroyRecord().catch(() => {
              get(this, 'notify').error(get(this, 'intl').t('errors.request'));
            });
          }).group('actionsTaskGroup')
        Severity: Major
        Found in app/components/groups/dashboard/members/member-list-user.js and 1 other location - About 1 hr to fix
        app/components/groups/dashboard/members/ban-list-user.js on lines 10..14

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 74.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          unbanUserTask: task(function* () {
            yield get(this, 'ban').destroyRecord().catch(() => {
              get(this, 'notify').error(get(this, 'intl').t('errors.request'));
            });
          }).drop()
        Severity: Major
        Found in app/components/groups/dashboard/members/ban-list-user.js and 1 other location - About 1 hr to fix
        app/components/groups/dashboard/members/member-list-user.js on lines 11..15

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 74.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          categories: computed('model.categories', function() {
            return get(this, 'model.categories').map(category => (
              {
                id: get(category, 'id'),
                name: get(category, 'name'),
        Severity: Major
        Found in app/controllers/groups/group/dashboard/settings.js and 1 other location - About 1 hr to fix
        app/controllers/groups/new.js on lines 13..21

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 73.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          categories: computed('model.categories', function() {
            return get(this, 'model.categories').map(category => (
              {
                id: get(category, 'id'),
                name: get(category, 'name'),
        Severity: Major
        Found in app/controllers/groups/new.js and 1 other location - About 1 hr to fix
        app/controllers/groups/group/dashboard/settings.js on lines 27..35

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 73.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          connectFacebook: task(function* () {
            yield get(this, 'facebook').connect(get(this, 'session.account')).catch(() => {
              get(this, 'session.account').rollbackAttributes();
            });
          }).group('facebookTasks'),
        Severity: Major
        Found in app/controllers/settings/linked-accounts.js and 1 other location - About 1 hr to fix
        app/controllers/settings/linked-accounts.js on lines 16..20

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 73.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

          disconnectFacebook: task(function* () {
            yield get(this, 'facebook').disconnect(get(this, 'session.account')).catch(() => {
              get(this, 'session.account').rollbackAttributes();
            });
          }).group('facebookTasks'),
        Severity: Major
        Found in app/controllers/settings/linked-accounts.js and 1 other location - About 1 hr to fix
        app/controllers/settings/linked-accounts.js on lines 10..14

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 73.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            yield comment.save().then(() => {
              invokeAction(this, 'trackEngagement', 'comment');
              get(this, 'metrics').trackEvent({ category: 'comment', action: 'create', value: get(this, 'post.id') });
            }).catch(err => {
              get(this, 'comments').removeObject(comment);
        Severity: Major
        Found in app/components/stream-feed/items/post/comments.js and 1 other location - About 1 hr to fix
        app/components/stream-feed/items/post/comment.js on lines 73..82

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 72.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            yield reply.save()
              .then(() => {
                invokeAction(this, 'trackEngagement', 'comment');
                get(this, 'metrics').trackEvent({ category: 'comment', action: 'reply', value: get(this, 'comment.id') });
              })
        Severity: Major
        Found in app/components/stream-feed/items/post/comment.js and 1 other location - About 1 hr to fix
        app/components/stream-feed/items/post/comments.js on lines 46..54

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 72.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function createPost has 46 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          createPost: task(function* (content, options) {
            const data = { content, user: get(this, 'session.account'), ...options };
            // posting on another user's profile
            if (get(this, 'user') !== undefined && get(this, 'user.id') !== get(this, 'session.account.id')) {
              set(data, 'targetUser', get(this, 'user'));
        Severity: Minor
        Found in app/components/stream-feed/list.js - About 1 hr to fix

          Function exports has 45 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          module.exports = function(deployTarget) {
            const ENV = {
              build: {},
              s3: {
                bucket: 'kitsu-web',
          Severity: Minor
          Found in config/deploy.js - About 1 hr to fix

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              didReceiveAttrs() {
                this._super(...arguments);
                if (get(this, 'type') === 'trending') {
                  get(this, 'getTrendingDataTask').perform();
                } else {
            Severity: Major
            Found in app/components/explore/explore-section.js and 1 other location - About 1 hr to fix
            app/components/explore/explore-more.js on lines 17..24

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 71.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Similar blocks of code found in 2 locations. Consider refactoring.
            Open

              didReceiveAttrs() {
                this._super(...arguments);
                if (get(this, 'type') === 'trending') {
                  get(this, 'getTrendingTask').perform();
                } else {
            Severity: Major
            Found in app/components/explore/explore-more.js and 1 other location - About 1 hr to fix
            app/components/explore/explore-section.js on lines 19..26

            Duplicated Code

            Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

            Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

            When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

            Tuning

            This issue has a mass of 71.

            We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

            The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

            If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

            See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

            Refactorings

            Further Reading

            Severity
            Category
            Status
            Source
            Language