loomio/loomio

View on GitHub

Showing 471 of 471 total issues

Function render has 39 lines of code (exceeds 25 allowed). Consider refactoring.
Open

      render: () => {
        return {
          onStart: props => {
            this.query = props.query.toLowerCase();
            this.suggestionRange = props.range;
Severity: Minor
Found in vue/src/components/lmo_textarea/mentioning.js - About 1 hr to fix

    Function constructor has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      constructor() {
        this.makeAdmin = {
          name: 'membership_dropdown.make_coordinator',
          canPerform(dr) {
            return !dr.discussion().group().adminsInclude(dr.user()) &&
    Severity: Minor
    Found in vue/src/shared/services/discussion_reader_service.js - About 1 hr to fix

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

        saveUnpin() {
          this.processing = true;
          return this.remote.patchMember(this.keyOrId(), 'unpin').finally(() => { return this.processing = false; });
        }
      Severity: Major
      Found in vue/src/shared/models/discussion_model.js and 3 other locations - About 1 hr to fix
      vue/src/shared/models/discussion_model.js on lines 316..319
      vue/src/shared/models/discussion_model.js on lines 326..329
      vue/src/shared/models/discussion_model.js on lines 331..334

      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 66.

      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 4 locations. Consider refactoring.
      Open

        savePin() {
          this.processing = true;
          return this.remote.patchMember(this.keyOrId(), 'pin').finally(() => { return this.processing = false; });
        }
      Severity: Major
      Found in vue/src/shared/models/discussion_model.js and 3 other locations - About 1 hr to fix
      vue/src/shared/models/discussion_model.js on lines 321..324
      vue/src/shared/models/discussion_model.js on lines 326..329
      vue/src/shared/models/discussion_model.js on lines 331..334

      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 66.

      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 4 locations. Consider refactoring.
      Open

        reopen() {
          this.processing = true;
          return this.remote.patchMember(this.keyOrId(), 'reopen').finally(() => { return this.processing = false; });
        }
      Severity: Major
      Found in vue/src/shared/models/discussion_model.js and 3 other locations - About 1 hr to fix
      vue/src/shared/models/discussion_model.js on lines 316..319
      vue/src/shared/models/discussion_model.js on lines 321..324
      vue/src/shared/models/discussion_model.js on lines 326..329

      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 66.

      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 4 locations. Consider refactoring.
      Open

        close() {
          this.processing = true;
          return this.remote.patchMember(this.keyOrId(), 'close').finally(() => { return this.processing = false; });
        }
      Severity: Major
      Found in vue/src/shared/models/discussion_model.js and 3 other locations - About 1 hr to fix
      vue/src/shared/models/discussion_model.js on lines 316..319
      vue/src/shared/models/discussion_model.js on lines 321..324
      vue/src/shared/models/discussion_model.js on lines 331..334

      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 66.

      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

        canAnnounce(model) {
          if ((typeof model.isA === 'function' ? model.isA('poll') : undefined)) {
            return this.canAnnouncePoll(model);
          } else {
            return this.canAnnounceDiscussion(model);
      Severity: Major
      Found in vue/src/shared/services/ability_service.js and 1 other location - About 1 hr to fix
      vue/src/shared/services/ability_service.js on lines 148..154

      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 66.

      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

        forkedEvent() {
          const res = this.recordStore.events.find({kind: 'discussion_forked', eventableId: this.id});
          if (!isEmpty(res)) { return res[0]; }
        }
      Severity: Major
      Found in vue/src/shared/models/discussion_model.js and 1 other location - About 1 hr to fix
      vue/src/shared/models/discussion_model.js on lines 149..152

      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 66.

      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

        createdEvent() {
          const res = this.recordStore.events.find({kind: 'new_discussion', eventableId: this.id});
          if (!isEmpty(res)) { return res[0]; }
        }
      Severity: Major
      Found in vue/src/shared/models/discussion_model.js and 1 other location - About 1 hr to fix
      vue/src/shared/models/discussion_model.js on lines 154..157

      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 66.

      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

        canAddGuests(model) {
          if ((typeof model.isA === 'function' ? model.isA('poll') : undefined)) {
            return this.canAddGuestsPoll(model);
          } else {
            return this.canAddGuestsDiscussion(model);
      Severity: Major
      Found in vue/src/shared/services/ability_service.js and 1 other location - About 1 hr to fix
      vue/src/shared/services/ability_service.js on lines 140..146

      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 66.

      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

      Method new_clone_group has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        def new_clone_group(group, clone_parent = nil)
          copy_fields = %w[
            name
            description
            description_format
      Severity: Minor
      Found in app/services/record_cloner.rb - About 1 hr to fix

        Method export_direct_threads has 38 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          def self.export_direct_threads(group_id)
            group = Group.find(group_id)
            group_ids = Group.find(group_id).id_and_subgroup_ids
            author_ids = Membership.where(group_id: group_ids).pluck(:user_id).uniq
            discussion_ids = Discussion.where(group_id: nil, author_id: author_ids).pluck(:id)
        Severity: Minor
        Found in app/services/group_export_service.rb - About 1 hr to fix

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

            undiscard() {
              this.processing = true;
              return this.remote.undiscard(this.keyOrId())
              .finally(() => {
                return this.processing = false;
          Severity: Major
          Found in vue/src/shared/record_store/base_model.js and 1 other location - About 1 hr to fix
          vue/src/shared/record_store/base_model.js on lines 285..291

          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 65.

          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

            discard() {
              this.processing = true;
              return this.remote.discard(this.keyOrId())
              .finally(() => {
                return this.processing = false;
          Severity: Major
          Found in vue/src/shared/record_store/base_model.js and 1 other location - About 1 hr to fix
          vue/src/shared/record_store/base_model.js on lines 293..299

          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 65.

          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

          Method update_model has 37 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def self.update_model(model, tasks_data)
              uids = tasks_data.map {|t| t[:uid] }
              existing_uids = model.tasks.pluck(:uid)
              new_uids = uids - existing_uids
              removed_uids = existing_uids - uids
          Severity: Minor
          Found in app/services/task_service.rb - About 1 hr to fix

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

                  change_password: {
                    icon: 'mdi-lock-reset',
                    name: 'profile_page.change_password_link',
                    canPerform() { return true; },
                    perform() {
            Severity: Major
            Found in vue/src/shared/services/user_service.js and 1 other location - About 1 hr to fix
            vue/src/shared/services/webhook_service.js on lines 38..51

            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 64.

            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

                  notification_history: {
                    name: 'action_dock.notification_history',
                    icon: 'mdi-alarm-check',
                    menu: true,
                    perform() {
            Severity: Major
            Found in vue/src/shared/services/outcome_service.js and 1 other location - About 1 hr to fix
            vue/src/shared/services/thread_service.js on lines 140..153

            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 64.

            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

                  notification_history: {
                    name: 'action_dock.notification_history',
                    icon: 'mdi-bell-ring-outline',
                    menu: true,
                    perform() {
            Severity: Major
            Found in vue/src/shared/services/thread_service.js and 1 other location - About 1 hr to fix
            vue/src/shared/services/outcome_service.js on lines 59..72

            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 64.

            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

              canDeletePoll(poll) {
                return (!poll.discussionId || !poll.discussion().closedAt) &&
                !poll.discardedAt && poll.adminsInclude(Session.user());
              }
            Severity: Major
            Found in vue/src/shared/services/ability_service.js and 1 other location - About 1 hr to fix
            vue/src/shared/services/ability_service.js on lines 316..319

            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 64.

            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

                  editWebhook: {
                    name: 'common.action.edit',
                    icon: 'mdi-pencil',
                    canPerform() { return true; },
                    perform() {
            Severity: Major
            Found in vue/src/shared/services/webhook_service.js and 1 other location - About 1 hr to fix
            vue/src/shared/services/user_service.js on lines 11..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 64.

            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