rubysg/rubysg-reboot

View on GitHub

Showing 10 of 13 total issues

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

  def ruby_sg_bot_joined_group?
    (tg_object[:chat][:type] == "group" || tg_object[:chat][:type] == "supergroup") &&
      tg_object[:new_chat_member] &&
      tg_object[:new_chat_member][:id].to_s == rubysg_bot_id
  end
Severity: Minor
Found in app/controllers/api/ruby_sg_bot_controller.rb and 1 other location - About 25 mins to fix
app/controllers/api/ruby_sg_bot_controller.rb on lines 38..42

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

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 ruby_sg_bot_left_group?
    (tg_object[:chat][:type] == "group" || tg_object[:chat][:type] == "supergroup") &&
      tg_object[:left_chat_member] &&
      tg_object[:left_chat_member][:id].to_s == rubysg_bot_id
  end
Severity: Minor
Found in app/controllers/api/ruby_sg_bot_controller.rb and 1 other location - About 25 mins to fix
app/controllers/api/ruby_sg_bot_controller.rb on lines 32..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 30.

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

  class BehindTheGems5 < FeedbackForm
    title "Behind the Gems 5 :: 6"

    questions [
      {
Severity: Major
Found in app/forms/feedback/behind_the_gems5.rb and 7 other locations - About 15 mins to fix
app/forms/feedback/behind_the_gems2.rb on lines 4..18
app/forms/feedback/behind_the_gems3.rb on lines 4..18
app/forms/feedback/behind_the_gems4.rb on lines 4..18
app/forms/feedback/meetup03082022.rb on lines 4..18
app/forms/feedback/meetup04102022.rb on lines 2..16
app/forms/feedback/meetup07092022.rb on lines 2..16
app/forms/feedback/meetup10052023.rb on lines 2..16

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

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

  class BehindTheGems3 < FeedbackForm
    title "Behind the Gems 3 :: 6"

    questions [
      {
Severity: Major
Found in app/forms/feedback/behind_the_gems3.rb and 7 other locations - About 15 mins to fix
app/forms/feedback/behind_the_gems2.rb on lines 4..18
app/forms/feedback/behind_the_gems4.rb on lines 4..18
app/forms/feedback/behind_the_gems5.rb on lines 4..18
app/forms/feedback/meetup03082022.rb on lines 4..18
app/forms/feedback/meetup04102022.rb on lines 2..16
app/forms/feedback/meetup07092022.rb on lines 2..16
app/forms/feedback/meetup10052023.rb on lines 2..16

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

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

  class BehindTheGems2 < FeedbackForm
    title "Behind the Gems 2 :: 6"

    questions [
      {
Severity: Major
Found in app/forms/feedback/behind_the_gems2.rb and 7 other locations - About 15 mins to fix
app/forms/feedback/behind_the_gems3.rb on lines 4..18
app/forms/feedback/behind_the_gems4.rb on lines 4..18
app/forms/feedback/behind_the_gems5.rb on lines 4..18
app/forms/feedback/meetup03082022.rb on lines 4..18
app/forms/feedback/meetup04102022.rb on lines 2..16
app/forms/feedback/meetup07092022.rb on lines 2..16
app/forms/feedback/meetup10052023.rb on lines 2..16

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

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

  class BehindTheGems4 < FeedbackForm
    title "Behind the Gems 4 :: 6"

    questions [
      {
Severity: Major
Found in app/forms/feedback/behind_the_gems4.rb and 7 other locations - About 15 mins to fix
app/forms/feedback/behind_the_gems2.rb on lines 4..18
app/forms/feedback/behind_the_gems3.rb on lines 4..18
app/forms/feedback/behind_the_gems5.rb on lines 4..18
app/forms/feedback/meetup03082022.rb on lines 4..18
app/forms/feedback/meetup04102022.rb on lines 2..16
app/forms/feedback/meetup07092022.rb on lines 2..16
app/forms/feedback/meetup10052023.rb on lines 2..16

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

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

  class Meetup03082022 < FeedbackForm
    title "August 2022 Meetup"

    questions [
      {
Severity: Major
Found in app/forms/feedback/meetup03082022.rb and 7 other locations - About 15 mins to fix
app/forms/feedback/behind_the_gems2.rb on lines 4..18
app/forms/feedback/behind_the_gems3.rb on lines 4..18
app/forms/feedback/behind_the_gems4.rb on lines 4..18
app/forms/feedback/behind_the_gems5.rb on lines 4..18
app/forms/feedback/meetup04102022.rb on lines 2..16
app/forms/feedback/meetup07092022.rb on lines 2..16
app/forms/feedback/meetup10052023.rb on lines 2..16

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

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

  class Meetup10052023 < FeedbackForm
    title "May 2023 Meetup"

    questions [
      {
Severity: Major
Found in app/forms/feedback/meetup10052023.rb and 7 other locations - About 15 mins to fix
app/forms/feedback/behind_the_gems2.rb on lines 4..18
app/forms/feedback/behind_the_gems3.rb on lines 4..18
app/forms/feedback/behind_the_gems4.rb on lines 4..18
app/forms/feedback/behind_the_gems5.rb on lines 4..18
app/forms/feedback/meetup03082022.rb on lines 4..18
app/forms/feedback/meetup04102022.rb on lines 2..16
app/forms/feedback/meetup07092022.rb on lines 2..16

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

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

  class Meetup07092022 < FeedbackForm
    title "September 2022 Meetup"

    questions [
      {
Severity: Major
Found in app/forms/feedback/meetup07092022.rb and 7 other locations - About 15 mins to fix
app/forms/feedback/behind_the_gems2.rb on lines 4..18
app/forms/feedback/behind_the_gems3.rb on lines 4..18
app/forms/feedback/behind_the_gems4.rb on lines 4..18
app/forms/feedback/behind_the_gems5.rb on lines 4..18
app/forms/feedback/meetup03082022.rb on lines 4..18
app/forms/feedback/meetup04102022.rb on lines 2..16
app/forms/feedback/meetup10052023.rb on lines 2..16

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

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

  class Meetup04102022 < FeedbackForm
    title "October 2022 Meetup"

    questions [
      {
Severity: Major
Found in app/forms/feedback/meetup04102022.rb and 7 other locations - About 15 mins to fix
app/forms/feedback/behind_the_gems2.rb on lines 4..18
app/forms/feedback/behind_the_gems3.rb on lines 4..18
app/forms/feedback/behind_the_gems4.rb on lines 4..18
app/forms/feedback/behind_the_gems5.rb on lines 4..18
app/forms/feedback/meetup03082022.rb on lines 4..18
app/forms/feedback/meetup07092022.rb on lines 2..16
app/forms/feedback/meetup10052023.rb on lines 2..16

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

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