mconf/mconf-web

View on GitHub

Showing 130 of 130 total issues

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

    if @invitation.recipient.nil?
      if @invitation.recipient_email.nil?
        Rails.logger.error "Aborting EventMailer because the destination user was not found"
        Rails.logger.error "Invitation: #{@invitation.inspect}"
        return
Severity: Minor
Found in app/mailers/event_mailer.rb and 1 other location - About 20 mins to fix
app/mailers/web_conference_mailer.rb on lines 16..25

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

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

  def registration_notification_email(user_id)
    user = User.find(user_id)
    I18n.with_locale(default_email_locale(user, nil)) do
      @user_name = user.name
      @subject = t("user_mailer.registration_notification_email.subject")
Severity: Minor
Found in app/mailers/user_mailer.rb and 2 other locations - About 15 mins to fix
app/mailers/admin_mailer.rb on lines 21..26
app/mailers/user_mailer.rb on lines 19..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 26.

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 self.notify_users_account_cancelled
    activities = get_recent_activity
      .where(trackable_type: 'User', notified: [nil, false], key: 'user.cancelled')
    activities.each do |activity|
      Queue::High.enqueue(UserNotificationsWorker, :cancelled_sender, activity.id)
Severity: Minor
Found in app/workers/user_notifications_worker.rb and 1 other location - About 15 mins to fix
app/workers/user_notifications_worker.rb on lines 64..68

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

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 self.notify_users_account_created_by_admin
    activities = get_recent_activity
      .where(trackable_type: 'User', notified: [nil, false], key: 'user.created_by_admin')
    activities.each do |activity|
      Queue::High.enqueue(UserNotificationsWorker, :registered_by_admin_sender, activity.id)
Severity: Minor
Found in app/workers/user_notifications_worker.rb and 1 other location - About 15 mins to fix
app/workers/user_notifications_worker.rb on lines 74..78

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

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

  def self.request_notifications
    requests = get_recent_activity.where trackable_type: 'JoinRequest', key: 'join_request.request', notified: [nil,false]
    requests.each do |activity|
      Queue::High.enqueue(JoinRequestsWorker, :request_sender, activity.id)
Severity: Minor
Found in app/workers/join_requests_worker.rb and 3 other locations - About 15 mins to fix
app/workers/join_requests_worker.rb on lines 20..23
app/workers/space_notifications_worker.rb on lines 39..43
app/workers/user_notifications_worker.rb on lines 84..88

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

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

  def self.notify_users_after_approved
    activities = get_recent_activity
      .where trackable_type: 'User', key: 'user.approved', notified: [nil, false]
    activities.each do |activity|
      Queue::High.enqueue(UserNotificationsWorker, :approved_sender, activity.id)
Severity: Minor
Found in app/workers/user_notifications_worker.rb and 3 other locations - About 15 mins to fix
app/workers/join_requests_worker.rb on lines 20..23
app/workers/join_requests_worker.rb on lines 29..32
app/workers/space_notifications_worker.rb on lines 39..43

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

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

  def new_user_approved(user_id)
    user = User.find(user_id)
    I18n.with_locale(default_email_locale(user, nil)) do
      @user_name = user.name
      @subject = t('admin_mailer.new_user_approved.subject')
Severity: Minor
Found in app/mailers/admin_mailer.rb and 2 other locations - About 15 mins to fix
app/mailers/user_mailer.rb on lines 10..15
app/mailers/user_mailer.rb on lines 19..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 26.

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

  def self.invite_notifications
    invites = get_recent_activity.where trackable_type: 'JoinRequest', key: 'join_request.invite', notified: [nil,false]
    invites.each do |activity|
      Queue::High.enqueue(JoinRequestsWorker, :invite_sender, activity.id)
Severity: Minor
Found in app/workers/join_requests_worker.rb and 3 other locations - About 15 mins to fix
app/workers/join_requests_worker.rb on lines 29..32
app/workers/space_notifications_worker.rb on lines 39..43
app/workers/user_notifications_worker.rb on lines 84..88

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

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

  def self.notify_space_admins_after_approved
    activities = get_recent_activity
      .where trackable_type: 'Space', key: 'space.approved', notified: [nil, false]
    activities.each do |activity|
      Queue::High.enqueue(SpaceNotificationsWorker, :approved_sender, activity.id)
Severity: Minor
Found in app/workers/space_notifications_worker.rb and 3 other locations - About 15 mins to fix
app/workers/join_requests_worker.rb on lines 20..23
app/workers/join_requests_worker.rb on lines 29..32
app/workers/user_notifications_worker.rb on lines 84..88

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

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

  def registration_by_admin_notification_email(user_id)
    user = User.find(user_id)
    I18n.with_locale(default_email_locale(user, nil)) do
      @user_name = user.name
      @subject = t("user_mailer.registration_by_admin_notification_email.subject")
Severity: Minor
Found in app/mailers/user_mailer.rb and 2 other locations - About 15 mins to fix
app/mailers/admin_mailer.rb on lines 21..26
app/mailers/user_mailer.rb on lines 10..15

Duplicated Code

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

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

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

Tuning

This issue has a mass of 26.

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