discourse/discourse

View on GitHub
db/fixtures/006_badges.rb

Summary

Maintainability
D
2 days
Test Coverage

File 006_badges.rb has 404 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'badge_queries'

BadgeGrouping.seed do |g|
  g.id = BadgeGrouping::GettingStarted
  g.name = "Getting Started"
Severity: Minor
Found in db/fixtures/006_badges.rb - About 5 hrs to fix

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

      [Badge::ThankYou,   "Thank You",  BadgeType::Bronze, 20, 10],
      [Badge::GivesBack,  "Gives Back", BadgeType::Silver, 100, 100],
      [Badge::Empathetic, "Empathetic", BadgeType::Gold,   500, 1000]
    ].each do |id, name, level, count, ratio|
      Badge.seed do |b|
    Severity: Major
    Found in db/fixtures/006_badges.rb and 1 other location - About 1 hr to fix
    db/fixtures/006_badges.rb on lines 304..317

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      [Badge::Appreciated, "Appreciated", BadgeType::Bronze, 1, 20],
      [Badge::Respected,   "Respected",   BadgeType::Silver, 2, 100],
      [Badge::Admired,     "Admired",     BadgeType::Gold,   5, 300],
    ].each do |id, name, level, like_count, post_count|
      Badge.seed do |b|
    Severity: Major
    Found in db/fixtures/006_badges.rb and 1 other location - About 1 hr to fix
    db/fixtures/006_badges.rb on lines 322..335

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 66.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

     [Badge::NiceShare, "Nice Share", BadgeType::Bronze, 25],
     [Badge::GoodShare, "Good Share", BadgeType::Silver, 300],
     [Badge::GreatShare, "Great Share", BadgeType::Gold, 1000],
    ].each do |id, name, level, count|
      Badge.seed do |b|
    Severity: Major
    Found in db/fixtures/006_badges.rb and 1 other location - About 1 hr to fix
    db/fixtures/006_badges.rb on lines 284..299

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 65.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

     [Badge::PopularLink, "Popular Link", BadgeType::Bronze, 50],
     [Badge::HotLink,     "Hot Link",     BadgeType::Silver, 300],
     [Badge::FamousLink,  "Famous Link",  BadgeType::Gold,   1000],
    ].each do |id, name, level, count|
      Badge.seed do |b|
    Severity: Major
    Found in db/fixtures/006_badges.rb and 1 other location - About 1 hr to fix
    db/fixtures/006_badges.rb on lines 182..197

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 65.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

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

      [Badge::Enthusiast, "Enthusiast", BadgeType::Bronze, 10],
      [Badge::Aficionado, "Aficionado", BadgeType::Silver, 100],
      [Badge::Devotee,    "Devotee",    BadgeType::Gold,   365],
    ].each do |id, name, level, days|
      Badge.seed do |b|
    Severity: Major
    Found in db/fixtures/006_badges.rb and 1 other location - About 1 hr to fix
    db/fixtures/006_badges.rb on lines 340..353

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

    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

      [Badge::OutOfLove,   "Out of Love",   BadgeType::Bronze, 1],
      [Badge::HigherLove,  "Higher Love",   BadgeType::Silver, 5],
      [Badge::CrazyInLove, "Crazy in Love", BadgeType::Gold,   20],
    ].each do |id, name, level, count|
      Badge.seed do |b|
    Severity: Major
    Found in db/fixtures/006_badges.rb and 1 other location - About 1 hr to fix
    db/fixtures/006_badges.rb on lines 423..436

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

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

    Badge.seed do |b|
      b.id = Badge::FirstLink
      b.name = "First Link"
      b.badge_type_id = BadgeType::Bronze
      b.multiple_grant = false
    Severity: Major
    Found in db/fixtures/006_badges.rb and 5 other locations - About 45 mins to fix
    db/fixtures/006_badges.rb on lines 105..115
    db/fixtures/006_badges.rb on lines 118..128
    db/fixtures/006_badges.rb on lines 167..178
    db/fixtures/006_badges.rb on lines 201..211
    db/fixtures/006_badges.rb on lines 357..367

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

    Badge.seed do |b|
      b.id = Badge::FirstLike
      b.name = "First Like"
      b.badge_type_id = BadgeType::Bronze
      b.multiple_grant = false
    Severity: Major
    Found in db/fixtures/006_badges.rb and 5 other locations - About 45 mins to fix
    db/fixtures/006_badges.rb on lines 92..102
    db/fixtures/006_badges.rb on lines 105..115
    db/fixtures/006_badges.rb on lines 167..178
    db/fixtures/006_badges.rb on lines 201..211
    db/fixtures/006_badges.rb on lines 357..367

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

    Badge.seed do |b|
      b.id = Badge::Welcome
      b.name = "Welcome"
      b.badge_type_id = BadgeType::Bronze
      b.multiple_grant = false
    Severity: Major
    Found in db/fixtures/006_badges.rb and 5 other locations - About 45 mins to fix
    db/fixtures/006_badges.rb on lines 92..102
    db/fixtures/006_badges.rb on lines 105..115
    db/fixtures/006_badges.rb on lines 118..128
    db/fixtures/006_badges.rb on lines 167..178
    db/fixtures/006_badges.rb on lines 357..367

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

    Badge.seed do |b|
      b.id = Badge::FirstQuote
      b.name = "First Quote"
      b.badge_type_id = BadgeType::Bronze
      b.multiple_grant = false
    Severity: Major
    Found in db/fixtures/006_badges.rb and 5 other locations - About 45 mins to fix
    db/fixtures/006_badges.rb on lines 92..102
    db/fixtures/006_badges.rb on lines 118..128
    db/fixtures/006_badges.rb on lines 167..178
    db/fixtures/006_badges.rb on lines 201..211
    db/fixtures/006_badges.rb on lines 357..367

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

    Badge.seed do |b|
      b.id = Badge::FirstShare
      b.name = "First Share"
      b.badge_type_id = BadgeType::Bronze
      b.multiple_grant = false
    Severity: Major
    Found in db/fixtures/006_badges.rb and 5 other locations - About 45 mins to fix
    db/fixtures/006_badges.rb on lines 92..102
    db/fixtures/006_badges.rb on lines 105..115
    db/fixtures/006_badges.rb on lines 118..128
    db/fixtures/006_badges.rb on lines 201..211
    db/fixtures/006_badges.rb on lines 357..367

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

    Badge.seed do |b|
      b.id = Badge::FirstMention
      b.name = "First Mention"
      b.badge_type_id = BadgeType::Bronze
      b.multiple_grant = false
    Severity: Major
    Found in db/fixtures/006_badges.rb and 5 other locations - About 45 mins to fix
    db/fixtures/006_badges.rb on lines 92..102
    db/fixtures/006_badges.rb on lines 105..115
    db/fixtures/006_badges.rb on lines 118..128
    db/fixtures/006_badges.rb on lines 167..178
    db/fixtures/006_badges.rb on lines 201..211

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

    Badge.seed do |b|
      b.id = Badge::FirstOnebox
      b.name = "First Onebox"
      b.badge_type_id = BadgeType::Bronze
      b.multiple_grant = false
    Severity: Major
    Found in db/fixtures/006_badges.rb and 2 other locations - About 45 mins to fix
    db/fixtures/006_badges.rb on lines 370..380
    db/fixtures/006_badges.rb on lines 396..406

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

    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

    Badge.seed do |b|
      b.id = Badge::FirstReplyByEmail
      b.name = "First Reply By Email"
      b.badge_type_id = BadgeType::Bronze
      b.multiple_grant = false
    Severity: Major
    Found in db/fixtures/006_badges.rb and 2 other locations - About 45 mins to fix
    db/fixtures/006_badges.rb on lines 370..380
    db/fixtures/006_badges.rb on lines 383..393

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

    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

    Badge.seed do |b|
      b.id = Badge::FirstEmoji
      b.name = "First Emoji"
      b.badge_type_id = BadgeType::Bronze
      b.multiple_grant = false
    Severity: Major
    Found in db/fixtures/006_badges.rb and 2 other locations - About 45 mins to fix
    db/fixtures/006_badges.rb on lines 383..393
    db/fixtures/006_badges.rb on lines 396..406

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

    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

    Badge.seed do |b|
      b.id = Badge::Editor
      b.name = "Editor"
      b.badge_type_id = BadgeType::Bronze
      b.multiple_grant = false
    Severity: Minor
    Found in db/fixtures/006_badges.rb and 1 other location - About 35 mins to fix
    db/fixtures/006_badges.rb on lines 214..222

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

    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

    Badge.seed do |b|
      b.id = Badge::Autobiographer
      b.name = "Autobiographer"
      b.badge_type_id = BadgeType::Bronze
      b.multiple_grant = false
    Severity: Minor
    Found in db/fixtures/006_badges.rb and 1 other location - About 35 mins to fix
    db/fixtures/006_badges.rb on lines 225..233

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

    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

    There are no issues that match your filters.

    Category
    Status