hummingbird-me/kitsu-web

View on GitHub

Showing 88 of 872 total issues

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

module.exports = function(environment) {
  const ENV = {
    modulePrefix: 'client',
    environment,
    rootURL: '/',
Severity: Major
Found in config/environment.js - About 6 hrs to fix

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

    module.exports = function(defaults) {
      const app = new EmberApp(defaults, {
        browseryStats: IS_DEV,
        hinting: IS_TEST,
        tests: IS_TEST,
    Severity: Major
    Found in ember-cli-build.js - About 5 hrs to fix

      File list.js has 296 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import Component from '@ember/component';
      import { all, task } from 'ember-concurrency';
      import EmberObject, { get, getProperties, set, observer } from '@ember/object';
      import { inject as service } from '@ember/service';
      import { isEmpty } from '@ember/utils';
      Severity: Minor
      Found in app/components/stream-feed/list.js - About 3 hrs to fix

        Function setHeadTags has 69 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          setHeadTags(model) {
            const tags = [];
            const content = get(model, 'content');
            if (content) {
              const description = content.substring(0, 140);
        Severity: Major
        Found in app/routes/posts.js - About 2 hrs to fix

          Function setHeadTags has 69 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            setHeadTags(model) {
              const tags = [];
              const content = get(model, 'content');
              if (content) {
                const description = content.substring(0, 140);
          Severity: Major
          Found in app/routes/comments.js - About 2 hrs to fix

            Function didReceiveAttrs has a Cognitive Complexity of 20 (exceeds 5 allowed). Consider refactoring.
            Open

              didReceiveAttrs() {
                this._super(...arguments);
            
                set(this, 'isPermalink', get(this, 'router.currentRouteName') === 'posts');
            
            
            Severity: Minor
            Found in app/components/stream-feed/items/post.js - About 2 hrs 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

            File create-post.js has 276 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import Component from '@ember/component';
            import { inject as service } from '@ember/service';
            import { get, set, setProperties, getProperties, computed } from '@ember/object';
            import { isEmpty, isPresent } from '@ember/utils';
            import { empty, notEmpty, and, or, equal } from '@ember/object/computed';
            Severity: Minor
            Found in app/components/stream-feed/create-post.js - About 2 hrs to fix

              Function link has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
              Open

                link: computed('activity', function() {
                  const activity = get(this, 'activity');
                  const streamId = get(this, 'group.streamId');
                  const queryParams = { isQueryParams: true, values: { notification: streamId } };
                  const [modelType, modelId] = get(activity, 'foreignId').split(':');
              Severity: Minor
              Found in app/components/application/user-notifications/item.js - About 2 hrs 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 link has 63 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                link: computed('activity', function() {
                  const activity = get(this, 'activity');
                  const streamId = get(this, 'group.streamId');
                  const queryParams = { isQueryParams: true, values: { notification: streamId } };
                  const [modelType, modelId] = get(activity, 'foreignId').split(':');
              Severity: Major
              Found in app/components/application/user-notifications/item.js - About 2 hrs to fix

                Function setHeadTags has 61 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  setHeadTags(model) {
                    const data = [{
                      type: 'meta',
                      tagId: 'meta-description',
                      attrs: {
                Severity: Major
                Found in app/routes/media/show.js - About 2 hrs to fix

                  Function setHeadTags has 58 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    setHeadTags(model) {
                      const description = get(model, 'content').substring(0, 140);
                      return [{
                        type: 'meta',
                        tagId: 'meta-description',
                  Severity: Major
                  Found in app/routes/reviews.js - About 2 hrs to fix

                    Function primaryUnit has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring.
                    Open

                      primaryUnit: computed('stat.time', function () {
                        if (get(this, 'kind') === 'anime') {
                          const time = moment.duration(get(this, 'stat.time'), 'seconds');
                          for (let i = 0; i < UNITS.length; i += 1) {
                            const unitTime = time.as(UNITS[i]);
                    Severity: Minor
                    Found in app/components/stats/time-spent.js - About 2 hrs 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 headTags has 56 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      headTags() {
                        const title = get(this, 'head.title');
                        const description = 'Share anime and manga experiences, get recommendations and see what friends are watching or reading.';
                        return [{
                          type: 'title',
                    Severity: Major
                    Found in app/routes/application.js - About 2 hrs to fix

                      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

                            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

                                Function setHeadTags has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                  setHeadTags(model) {
                                    const description = get(model, 'reaction');
                                    return [{
                                      type: 'meta',
                                      tagId: 'meta-description',
                                Severity: Minor
                                Found in app/routes/media-reactions.js - About 1 hr to fix

                                  Function didReceiveAttrs has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    didReceiveAttrs() {
                                      this._super(...arguments);
                                  
                                      set(this, 'isPermalink', get(this, 'router.currentRouteName') === 'posts');
                                  
                                  
                                  Severity: Minor
                                  Found in app/components/stream-feed/items/post.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language