loomio/loomio

View on GitHub

Showing 469 of 469 total issues

Class Event has 26 methods (exceeds 20 allowed). Consider refactoring.
Open

class Event < ApplicationRecord
  include ActionView::Helpers::SanitizeHelper
  include CustomCounterCache::Model
  include HasTimeframe
  extend HasCustomFields
Severity: Minor
Found in app/models/event.rb - About 3 hrs to fix

    EventModel has 26 functions (exceeds 20 allowed). Consider refactoring.
    Open

    export default class EventModel extends BaseModel {
      static singular = 'event';
      static plural = 'events';
      static indices = ['discussionId', 'sequenceId', 'position', 'depth', 'parentId', 'positionKey'];
      static uniqueIndices = ['id'];
    Severity: Minor
    Found in vue/src/shared/models/event_model.js - About 3 hrs to fix

      Class DiscussionsController has 26 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class API::V1::DiscussionsController < API::V1::RestfulController
        def create
          instantiate_resource
          if resource_params[:forked_event_ids] && resource_params[:forked_event_ids].any?
            EventService.move_comments(discussion: create_action.discussion, params: resource_params, actor: current_user)
      Severity: Minor
      Found in app/controllers/api/v1/discussions_controller.rb - About 3 hrs to fix

        File ability_service.js has 291 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        import AppConfig     from '@/shared/services/app_config';
        import Records       from '@/shared/services/records';
        import Session       from '@/shared/services/session';
        import LmoUrlService from '@/shared/services/lmo_url_service';
        import {intersection} from 'lodash-es';
        Severity: Minor
        Found in vue/src/shared/services/ability_service.js - About 3 hrs to fix

          Function actions has 74 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            actions(stance, vm, event) {
              return {
                react: {
                  dock: 1,
                  canPerform() {
          Severity: Major
          Found in vue/src/shared/services/stance_service.js - About 2 hrs to fix

            File base_model.js has 288 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            import utils from './utils';
            import Vue from 'vue';
            import { isEqual } from 'date-fns';
            import { camelCase, union, each, isArray, keys, filter, snakeCase, defaults, orderBy, assign, includes, pick } from 'lodash-es';
            
            
            Severity: Minor
            Found in vue/src/shared/record_store/base_model.js - About 2 hrs to fix

              Method event has 71 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                def event(recipient_id, event_id)
                  @current_user = @recipient = User.find_by!(id: recipient_id)
                  @event = Event.find_by!(id: event_id)
                  @notification = Notification.find_by(user_id: recipient_id, event_id: event_id)
                  
              Severity: Major
              Found in app/mailers/event_mailer.rb - About 2 hrs to fix

                Class SlackMrkdwn has 25 methods (exceeds 20 allowed). Consider refactoring.
                Open

                class SlackMrkdwn < Redcarpet::Render::Base
                  class << self
                    def from(markdown)
                      renderer = SlackMrkdwn.new
                      Redcarpet::Markdown.new(renderer, strikethrough: true, underline: true, fenced_code_blocks: true).render(markdown)
                Severity: Minor
                Found in lib/slack_mrkdwn.rb - About 2 hrs to fix

                  Method ransackable_attributes has 68 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    def self.ransackable_attributes(auth_object = nil)
                      [
                      "admin_memberships_count",
                      "admin_tags",
                      "admins_can_edit_user_content",
                  Severity: Major
                  Found in app/models/group.rb - About 2 hrs to fix

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

                          translate_comment: {
                            name: 'common.action.translate',
                            icon: 'mdi-translate',
                            dock: 2,
                            canPerform() {
                    Severity: Major
                    Found in vue/src/shared/services/comment_service.js and 1 other location - About 2 hrs to fix
                    vue/src/shared/services/group_service.js on lines 36..46

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

                    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

                          translate_group: {
                            name: 'common.action.translate',
                            icon: 'mdi-translate',
                            dock: 2,
                            canPerform() {
                    Severity: Major
                    Found in vue/src/shared/services/group_service.js and 1 other location - About 2 hrs to fix
                    vue/src/shared/services/comment_service.js on lines 13..23

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

                    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

                    File scenarios_helper.rb has 279 lines of code (exceeds 250 allowed). Consider refactoring.
                    Open

                    module Dev::ScenariosHelper
                      include Dev::FakeDataHelper
                      
                      def poll_created_scenario(params)
                        group = create_group_with_members
                    Severity: Minor
                    Found in app/helpers/dev/scenarios_helper.rb - About 2 hrs to fix

                      Method initialize has 67 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        def initialize(user)
                          super(user)
                      
                          can :vote_in, ::Poll do |poll|
                            user.is_logged_in? &&
                      Severity: Major
                      Found in app/models/ability/poll.rb - About 2 hrs to fix

                        StanceModel has 24 functions (exceeds 20 allowed). Consider refactoring.
                        Open

                        export default class StanceModel extends BaseModel {
                          static singular = 'stance';
                          static plural = 'stances';
                          static indices = ['pollId', 'latest', 'participantId'];
                          static uniqueIndices = ['id'];
                        Severity: Minor
                        Found in vue/src/shared/models/stance_model.js - About 2 hrs to fix

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

                                print_poll: {
                                  name: 'common.action.print',
                                  icon: 'mdi-printer-outline',
                                  menu: true,
                                  canPerform() {
                          Severity: Major
                          Found in vue/src/shared/services/poll_service.js and 1 other location - About 2 hrs to fix
                          vue/src/shared/services/poll_service.js on lines 241..251

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

                          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

                                unsubscribe: {
                                  name: 'common.action.unsubscribe',
                                  icon: 'mdi-bell-off',
                                  dock: 2,
                                  canPerform() {
                          Severity: Major
                          Found in vue/src/shared/services/thread_service.js and 1 other location - About 2 hrs to fix
                          vue/src/shared/services/thread_service.js on lines 65..80

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

                          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

                                unignore: {
                                  name: 'common.action.unignore',
                                  icon: 'mdi-bell-outline',
                                  dock: 2,
                                  canPerform() {
                          Severity: Major
                          Found in vue/src/shared/services/thread_service.js and 1 other location - About 2 hrs to fix
                          vue/src/shared/services/thread_service.js on lines 48..63

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

                          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

                                edit_template: {
                                  name: 'poll_common.edit_template',
                                  icon: 'mdi-pencil',
                                  menu: true,
                                  canPerform() { return discussionTemplate.id && group.adminsInclude(Session.user()); },
                          Severity: Major
                          Found in vue/src/shared/services/discussion_template_service.js and 1 other location - About 2 hrs to fix
                          vue/src/shared/services/poll_template_service.js on lines 32..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 87.

                          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

                                edit_template: {
                                  name: 'poll_common.edit_template',
                                  icon: 'mdi-pencil',
                                  menu: true,
                                  canPerform() { return pollTemplate.id && group.adminsInclude(Session.user()); },
                          Severity: Major
                          Found in vue/src/shared/services/poll_template_service.js and 1 other location - About 2 hrs to fix
                          vue/src/shared/services/discussion_template_service.js on lines 26..34

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

                          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

                                export_poll: {
                                  name: 'common.action.export',
                                  icon: 'mdi-database-arrow-right-outline',
                                  menu: true,
                                  canPerform() {
                          Severity: Major
                          Found in vue/src/shared/services/poll_service.js and 1 other location - About 2 hrs to fix
                          vue/src/shared/services/poll_service.js on lines 253..263

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

                          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