loomio/loomio

View on GitHub

Showing 212 of 472 total issues

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

  def positions
    group = current_user.adminable_groups.find_by!(id: params[:group_id])
    params[:ids].each_with_index do |val, index|
      if val.is_a? Integer
        PollTemplate.where(id: val, group_id: group.id).update_all(position: index)
Severity: Minor
Found in app/controllers/api/v1/poll_templates_controller.rb and 1 other location - About 45 mins to fix
app/controllers/api/v1/discussion_templates_controller.rb on lines 68..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 41.

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

  def positions
    group = current_user.adminable_groups.find_by!(id: params[:group_id])
    
    params[:ids].each_with_index do |val, index|
      if val.is_a? Integer
Severity: Minor
Found in app/controllers/api/v1/discussion_templates_controller.rb and 1 other location - About 45 mins to fix
app/controllers/api/v1/poll_templates_controller.rb on lines 30..41

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

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

    if (typeof model.isA === 'function' ? model.isA('poll') : undefined) { ids['poll_ids'].push(model.id); }
Severity: Major
Found in vue/src/shared/services/reaction_service.js and 4 other locations - About 45 mins to fix
vue/src/shared/services/reaction_service.js on lines 33..33
vue/src/shared/services/reaction_service.js on lines 34..34
vue/src/shared/services/reaction_service.js on lines 35..35
vue/src/shared/services/reaction_service.js on lines 37..37

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

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

    if (typeof model.isA === 'function' ? model.isA('comment') : undefined) { ids['comment_ids'].push(model.id); }
Severity: Major
Found in vue/src/shared/services/reaction_service.js and 4 other locations - About 45 mins to fix
vue/src/shared/services/reaction_service.js on lines 33..33
vue/src/shared/services/reaction_service.js on lines 35..35
vue/src/shared/services/reaction_service.js on lines 36..36
vue/src/shared/services/reaction_service.js on lines 37..37

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

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

    if (typeof model.isA === 'function' ? model.isA('outcome') : undefined) { ids['outcome_ids'].push(model.id); }
Severity: Major
Found in vue/src/shared/services/reaction_service.js and 4 other locations - About 45 mins to fix
vue/src/shared/services/reaction_service.js on lines 33..33
vue/src/shared/services/reaction_service.js on lines 34..34
vue/src/shared/services/reaction_service.js on lines 35..35
vue/src/shared/services/reaction_service.js on lines 36..36

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

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

    if (typeof model.isA === 'function' ? model.isA('discussion') : undefined) { ids['discussion_ids'].push(model.id); }
Severity: Major
Found in vue/src/shared/services/reaction_service.js and 4 other locations - About 45 mins to fix
vue/src/shared/services/reaction_service.js on lines 33..33
vue/src/shared/services/reaction_service.js on lines 34..34
vue/src/shared/services/reaction_service.js on lines 36..36
vue/src/shared/services/reaction_service.js on lines 37..37

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

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

    if (typeof model.isA === 'function' ? model.isA('stance') : undefined) { ids['stance_ids'].push(model.id); }
Severity: Major
Found in vue/src/shared/services/reaction_service.js and 4 other locations - About 45 mins to fix
vue/src/shared/services/reaction_service.js on lines 34..34
vue/src/shared/services/reaction_service.js on lines 35..35
vue/src/shared/services/reaction_service.js on lines 36..36
vue/src/shared/services/reaction_service.js on lines 37..37

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

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

  searchResultsCount(options) {
    if (options == null) { options = {}; }
    return this.fetch({
      path: 'search_results_count',
      params: options
Severity: Minor
Found in vue/src/shared/interfaces/poll_records_interface.js and 1 other location - About 45 mins to fix
vue/src/shared/interfaces/poll_records_interface.js on lines 17..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 50.

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

    perform(poll, user) {
      return Records.remote.post('stances/remove_admin', {participant_id: user.id, poll_id: poll.id, exclude_types: 'discussion'});
    }
Severity: Minor
Found in vue/src/shared/services/stance_service.js and 1 other location - About 45 mins to fix
vue/src/shared/services/stance_service.js on lines 17..19

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

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

  search(options) {
    if (options == null) { options = {}; }
    return this.fetch({
      path: 'search',
      params: options
Severity: Minor
Found in vue/src/shared/interfaces/poll_records_interface.js and 1 other location - About 45 mins to fix
vue/src/shared/interfaces/poll_records_interface.js on lines 25..31

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

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

    } else {
      return thread.savePin().then(() => {
        return Flash.success("discussion.pin.pinned", 'undo', () => this.unpin(thread));
      });
    }
Severity: Minor
Found in vue/src/shared/services/thread_service.js and 1 other location - About 45 mins to fix
vue/src/shared/services/thread_service.js on lines 375..379

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

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

    perform(poll, user) {
      return Records.remote.post('stances/make_admin', {participant_id: user.id, poll_id: poll.id, exclude_types: 'discussion'});
    }
Severity: Minor
Found in vue/src/shared/services/stance_service.js and 1 other location - About 45 mins to fix
vue/src/shared/services/stance_service.js on lines 27..29

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

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

  unpin(thread) {
    return thread.saveUnpin().then(() => {
      return Flash.success("discussion.pin.unpinned", 'undo', () => this.pin(thread));
    });
  }
Severity: Minor
Found in vue/src/shared/services/thread_service.js and 1 other location - About 45 mins to fix
vue/src/shared/services/thread_service.js on lines 368..372

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

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

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

  def self.attributes_from_reader(*attrs)
    attrs.each do |attr|
      case attr
      when :discussion_reader_id then define_method attr, -> { reader.id }
      else                            define_method attr, -> { reader.send(attr) }
Severity: Minor
Found in app/serializers/marked_as_read/discussion_serializer.rb and 1 other location - About 40 mins to fix
app/serializers/discussion_serializer.rb on lines 2..11

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

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

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

  def self.attributes_from_reader(*attrs)
    attrs.each do |attr|
      case attr
      when :discussion_reader_id then define_method attr, -> { reader.id }
      else                            define_method attr, -> { reader.send(attr) }
Severity: Minor
Found in app/serializers/discussion_serializer.rb and 1 other location - About 40 mins to fix
app/serializers/marked_as_read/discussion_serializer.rb on lines 4..13

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

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

export default class SessionRecordsInterface extends BaseRecordsInterface {
  constructor(recordStore) {
    super(recordStore);
    this.model = SessionModel;
    this.baseConstructor(recordStore);
Severity: Major
Found in vue/src/shared/interfaces/session_records_interface.js and 16 other locations - About 40 mins to fix
vue/src/shared/interfaces/attachment_records_interface.js on lines 4..10
vue/src/shared/interfaces/chatbot_records_interface.js on lines 4..10
vue/src/shared/interfaces/comment_records_interface.js on lines 4..10
vue/src/shared/interfaces/contact_message_records_interface.js on lines 4..10
vue/src/shared/interfaces/contact_request_records_interface.js on lines 4..10
vue/src/shared/interfaces/discussion_reader_records_interface.js on lines 4..10
vue/src/shared/interfaces/discussion_template_records_interface.js on lines 4..10
vue/src/shared/interfaces/outcome_records_interface.js on lines 4..10
vue/src/shared/interfaces/poll_option_records_interface.js on lines 4..10
vue/src/shared/interfaces/reaction_records_interface.js on lines 4..10
vue/src/shared/interfaces/received_email_records_interface.js on lines 4..10
vue/src/shared/interfaces/registration_records_interface.js on lines 4..10
vue/src/shared/interfaces/stance_records_interface.js on lines 4..10
vue/src/shared/interfaces/tag_records_interface.js on lines 4..10
vue/src/shared/interfaces/task_records_interface.js on lines 4..10
vue/src/shared/interfaces/webhook_records_interface.js on lines 4..10

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

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

export default class ContactRequestRecordsInterface extends BaseRecordsInterface {
  constructor(recordStore) {
    super(recordStore);
    this.model = ContactRequestModel;
    this.baseConstructor(recordStore);
vue/src/shared/interfaces/attachment_records_interface.js on lines 4..10
vue/src/shared/interfaces/chatbot_records_interface.js on lines 4..10
vue/src/shared/interfaces/comment_records_interface.js on lines 4..10
vue/src/shared/interfaces/contact_message_records_interface.js on lines 4..10
vue/src/shared/interfaces/discussion_reader_records_interface.js on lines 4..10
vue/src/shared/interfaces/discussion_template_records_interface.js on lines 4..10
vue/src/shared/interfaces/outcome_records_interface.js on lines 4..10
vue/src/shared/interfaces/poll_option_records_interface.js on lines 4..10
vue/src/shared/interfaces/reaction_records_interface.js on lines 4..10
vue/src/shared/interfaces/received_email_records_interface.js on lines 4..10
vue/src/shared/interfaces/registration_records_interface.js on lines 4..10
vue/src/shared/interfaces/session_records_interface.js on lines 4..10
vue/src/shared/interfaces/stance_records_interface.js on lines 4..10
vue/src/shared/interfaces/tag_records_interface.js on lines 4..10
vue/src/shared/interfaces/task_records_interface.js on lines 4..10
vue/src/shared/interfaces/webhook_records_interface.js on lines 4..10

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

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

export default class TagRecordsInterface extends BaseRecordsInterface {
  constructor(recordStore) {
    super(recordStore);
    this.model = TagModel;
    this.baseConstructor(recordStore);
Severity: Major
Found in vue/src/shared/interfaces/tag_records_interface.js and 16 other locations - About 40 mins to fix
vue/src/shared/interfaces/attachment_records_interface.js on lines 4..10
vue/src/shared/interfaces/chatbot_records_interface.js on lines 4..10
vue/src/shared/interfaces/comment_records_interface.js on lines 4..10
vue/src/shared/interfaces/contact_message_records_interface.js on lines 4..10
vue/src/shared/interfaces/contact_request_records_interface.js on lines 4..10
vue/src/shared/interfaces/discussion_reader_records_interface.js on lines 4..10
vue/src/shared/interfaces/discussion_template_records_interface.js on lines 4..10
vue/src/shared/interfaces/outcome_records_interface.js on lines 4..10
vue/src/shared/interfaces/poll_option_records_interface.js on lines 4..10
vue/src/shared/interfaces/reaction_records_interface.js on lines 4..10
vue/src/shared/interfaces/received_email_records_interface.js on lines 4..10
vue/src/shared/interfaces/registration_records_interface.js on lines 4..10
vue/src/shared/interfaces/session_records_interface.js on lines 4..10
vue/src/shared/interfaces/stance_records_interface.js on lines 4..10
vue/src/shared/interfaces/task_records_interface.js on lines 4..10
vue/src/shared/interfaces/webhook_records_interface.js on lines 4..10

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

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

export default class RegistrationRecordsInterface extends BaseRecordsInterface {
  constructor(recordStore) {
    super(recordStore);
    this.model = RegistrationModel;
    this.baseConstructor(recordStore);
Severity: Major
Found in vue/src/shared/interfaces/registration_records_interface.js and 16 other locations - About 40 mins to fix
vue/src/shared/interfaces/attachment_records_interface.js on lines 4..10
vue/src/shared/interfaces/chatbot_records_interface.js on lines 4..10
vue/src/shared/interfaces/comment_records_interface.js on lines 4..10
vue/src/shared/interfaces/contact_message_records_interface.js on lines 4..10
vue/src/shared/interfaces/contact_request_records_interface.js on lines 4..10
vue/src/shared/interfaces/discussion_reader_records_interface.js on lines 4..10
vue/src/shared/interfaces/discussion_template_records_interface.js on lines 4..10
vue/src/shared/interfaces/outcome_records_interface.js on lines 4..10
vue/src/shared/interfaces/poll_option_records_interface.js on lines 4..10
vue/src/shared/interfaces/reaction_records_interface.js on lines 4..10
vue/src/shared/interfaces/received_email_records_interface.js on lines 4..10
vue/src/shared/interfaces/session_records_interface.js on lines 4..10
vue/src/shared/interfaces/stance_records_interface.js on lines 4..10
vue/src/shared/interfaces/tag_records_interface.js on lines 4..10
vue/src/shared/interfaces/task_records_interface.js on lines 4..10
vue/src/shared/interfaces/webhook_records_interface.js on lines 4..10

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

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

export default class PollOptionRecordsInterface extends BaseRecordsInterface {
  constructor(recordStore) {
    super(recordStore);
    this.model = PollOptionModel;
    this.baseConstructor(recordStore);
Severity: Major
Found in vue/src/shared/interfaces/poll_option_records_interface.js and 16 other locations - About 40 mins to fix
vue/src/shared/interfaces/attachment_records_interface.js on lines 4..10
vue/src/shared/interfaces/chatbot_records_interface.js on lines 4..10
vue/src/shared/interfaces/comment_records_interface.js on lines 4..10
vue/src/shared/interfaces/contact_message_records_interface.js on lines 4..10
vue/src/shared/interfaces/contact_request_records_interface.js on lines 4..10
vue/src/shared/interfaces/discussion_reader_records_interface.js on lines 4..10
vue/src/shared/interfaces/discussion_template_records_interface.js on lines 4..10
vue/src/shared/interfaces/outcome_records_interface.js on lines 4..10
vue/src/shared/interfaces/reaction_records_interface.js on lines 4..10
vue/src/shared/interfaces/received_email_records_interface.js on lines 4..10
vue/src/shared/interfaces/registration_records_interface.js on lines 4..10
vue/src/shared/interfaces/session_records_interface.js on lines 4..10
vue/src/shared/interfaces/stance_records_interface.js on lines 4..10
vue/src/shared/interfaces/tag_records_interface.js on lines 4..10
vue/src/shared/interfaces/task_records_interface.js on lines 4..10
vue/src/shared/interfaces/webhook_records_interface.js on lines 4..10

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

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