assemblymade/coderwall

View on GitHub

Showing 57 of 189 total issues

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

  def reasons
    @reasons ||= begin
      links = []
      user.facts.each do |fact|
        if fact.tagged?('conference', 'attended') && fact.metadata[:name] == 'railsberry'
Severity: Major
Found in app/badges/railsberry.rb and 3 other locations - About 35 mins to fix
app/badges/hackathon_cmu.rb on lines 8..18
app/badges/hackathon_stanford.rb on lines 8..18
app/badges/wroc_lover.rb on lines 8..18

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

  def reasons
    @reasons ||= begin
      links = []
      user.facts.each do |fact|
        if fact.tagged?('conference', 'attended') && fact.metadata[:name] == 'WrocLove'
Severity: Major
Found in app/badges/wroc_lover.rb and 3 other locations - About 35 mins to fix
app/badges/hackathon_cmu.rb on lines 8..18
app/badges/hackathon_stanford.rb on lines 8..18
app/badges/railsberry.rb on lines 8..18

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

  def reasons
    @reasons ||= begin
      links = []
      user.facts.each do |fact|
        if fact.tagged?('hackathon', 'university') && fact.metadata[:school] == 'Stanford'
Severity: Major
Found in app/badges/hackathon_stanford.rb and 3 other locations - About 35 mins to fix
app/badges/hackathon_cmu.rb on lines 8..18
app/badges/railsberry.rb on lines 8..18
app/badges/wroc_lover.rb on lines 8..18

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

  def deny_join
    deny_join_params = params.permit(:id, :user_id)

    @team = Team.find(deny_join_params[:id])
    return head(:forbidden) unless @team && @team.admin?(current_user)
Severity: Minor
Found in app/controllers/teams_controller.rb and 1 other location - About 35 mins to fix
app/controllers/teams_controller.rb on lines 247..255

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

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 approve_join
    approve_join_params = params.permit(:id, :user_id)

    @team = Team.find(approve_join_params[:id])
    return head(:forbidden) unless @team && @team.admin?(current_user)
Severity: Minor
Found in app/controllers/teams_controller.rb and 1 other location - About 35 mins to fix
app/controllers/teams_controller.rb on lines 258..266

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

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

      respond_to do |format|
        format.json { render json: { dom_id: dom_id(@user), following: current_user.following?(@user) } }
        format.js { render json: { dom_id: dom_id(@user), following: current_user.following?(@user) } }
Severity: Minor
Found in app/controllers/follows_controller.rb and 1 other location - About 30 mins to fix
app/controllers/teams_controller.rb on lines 150..152

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

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

    respond_to do |format|
      format.json { render json: { dom_id: dom_id(@team), following: current_user.following_team?(@team) } }
      format.js { render json: { dom_id: dom_id(@team), following: current_user.following_team?(@team) } }
Severity: Minor
Found in app/controllers/teams_controller.rb and 1 other location - About 30 mins to fix
app/controllers/follows_controller.rb on lines 33..35

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

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

        Object.const_set "GithubGameoffRunnerUp#{year}", Class.new(BadgeBase) {
          describe "Github Gameoff Runner Up",
                   skill:       'game development',
                   description: "Was runner up in the Github Gameoff #{year} building a game based on git concepts of forking, branching, etc",
                   for:         "being the runner up in the Github Gameoff #{year} building a game based on git concepts of forking, branching, etc",
Severity: Major
Found in app/badges/github_gameoff.rb and 4 other locations - About 25 mins to fix
app/badges/github_gameoff.rb on lines 5..12
app/badges/github_gameoff.rb on lines 14..21
app/badges/github_gameoff.rb on lines 32..39
app/badges/github_gameoff.rb on lines 41..48

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

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

        Object.const_set "GithubGameoffParticipant#{year}", Class.new(BadgeBase) {
          describe "Github Gameoff Participant",
                   skill:       'game development',
                   description: "Participated in the Github Gameoff #{year} building a game based on git concepts of forking, branching, etc",
                   for:         "participating in the Github Gameoff #{year} building a game based on git concepts of forking, branching, etc",
Severity: Major
Found in app/badges/github_gameoff.rb and 4 other locations - About 25 mins to fix
app/badges/github_gameoff.rb on lines 5..12
app/badges/github_gameoff.rb on lines 14..21
app/badges/github_gameoff.rb on lines 23..30
app/badges/github_gameoff.rb on lines 32..39

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

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 join
    redirect_to_signup_if_unauthenticated(request.referer, 'You must login/signup to join a network') do
      return leave if current_user.member_of?(@network)
      current_user.join(@network)
      respond_to do |format|
Severity: Minor
Found in app/controllers/networks_controller.rb and 1 other location - About 25 mins to fix
app/controllers/networks_controller.rb on lines 34..39

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

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

        Object.const_set "GithubGameoffWinner#{year}", Class.new(BadgeBase) {
          describe "Github Gameoff Participant",
                   skill:       'game development',
                   description: "Won the Github Gameoff #{year} building a game based on git concepts of forking, branching, etc",
                   for:         "winning the Github Gameoff #{year} building a game based on git concepts of forking, branching, etc",
Severity: Major
Found in app/badges/github_gameoff.rb and 4 other locations - About 25 mins to fix
app/badges/github_gameoff.rb on lines 5..12
app/badges/github_gameoff.rb on lines 23..30
app/badges/github_gameoff.rb on lines 32..39
app/badges/github_gameoff.rb on lines 41..48

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

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

        Object.const_set "GithubGameoffHonorableMention#{year}", Class.new(BadgeBase) {
          describe "Github Gameoff Honorable Mention",
                   skill:       'game development',
                   description: "Was an honorable mention in the Github Gameoff #{year} building a game based on git concepts of forking, branching, etc",
                   for:         "being noted an honorable mention in the Github Gameoff #{year} building a game based on git concepts of forking, branching, etc",
Severity: Major
Found in app/badges/github_gameoff.rb and 4 other locations - About 25 mins to fix
app/badges/github_gameoff.rb on lines 5..12
app/badges/github_gameoff.rb on lines 14..21
app/badges/github_gameoff.rb on lines 23..30
app/badges/github_gameoff.rb on lines 41..48

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

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

        Object.const_set "GithubGameoffJudge#{year}", Class.new(BadgeBase) {
          describe "Github Gameoff Judge",
                   skill:       'game development',
                   description: "Was a judge in the Github Gameoff #{year} building a game based on git concepts of forking, branching, etc",
                   for:         "judging the Github Gameoff #{year} building a game based on git concepts of forking, branching, etc",
Severity: Major
Found in app/badges/github_gameoff.rb and 4 other locations - About 25 mins to fix
app/badges/github_gameoff.rb on lines 14..21
app/badges/github_gameoff.rb on lines 23..30
app/badges/github_gameoff.rb on lines 32..39
app/badges/github_gameoff.rb on lines 41..48

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

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 leave
    redirect_to_signup_if_unauthenticated(request.referer, 'You must login/signup to leave a network') do
      return join unless current_user.member_of?(@network)
      current_user.leave(@network)
      respond_to do |format|
Severity: Minor
Found in app/controllers/networks_controller.rb and 1 other location - About 25 mins to fix
app/controllers/networks_controller.rb on lines 23..28

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

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

    const_set "MostUseful#{year}", Class.new(BadgeBase) {
      describe "KO Utility",
               skill:       'Node.js',
               description: "Won the most useful app in the #{year} Node Knockout",
               for:         "winning the most useful app in the #{year} Node Knockout",
Severity: Major
Found in app/badges/node_knockout.rb and 7 other locations - About 25 mins to fix
app/badges/node_knockout.rb on lines 149..156
app/badges/node_knockout.rb on lines 158..165
app/badges/node_knockout.rb on lines 167..174
app/badges/node_knockout.rb on lines 176..183
app/badges/node_knockout.rb on lines 185..192
app/badges/node_knockout.rb on lines 203..210
app/badges/node_knockout.rb on lines 212..219

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

    const_set "MostComplete#{year}", Class.new(BadgeBase) {
      describe "KO Complete",
               skill:       'Node.js',
               description: "Won the most complete app in the #{year} Node Knockout",
               for:         "winning the most complete app in the #{year} Node Knockout",
Severity: Major
Found in app/badges/node_knockout.rb and 7 other locations - About 25 mins to fix
app/badges/node_knockout.rb on lines 149..156
app/badges/node_knockout.rb on lines 158..165
app/badges/node_knockout.rb on lines 167..174
app/badges/node_knockout.rb on lines 176..183
app/badges/node_knockout.rb on lines 185..192
app/badges/node_knockout.rb on lines 194..201
app/badges/node_knockout.rb on lines 203..210

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

    const_set "MostInnovative#{year}", Class.new(BadgeBase) {
      describe "KO Innovation",
               skill:       'Node.js',
               description: "Won the most innovative app in the #{year} Node Knockout",
               for:         "winning the most innovative app in the #{year} Node Knockout",
Severity: Major
Found in app/badges/node_knockout.rb and 7 other locations - About 25 mins to fix
app/badges/node_knockout.rb on lines 149..156
app/badges/node_knockout.rb on lines 158..165
app/badges/node_knockout.rb on lines 167..174
app/badges/node_knockout.rb on lines 176..183
app/badges/node_knockout.rb on lines 185..192
app/badges/node_knockout.rb on lines 194..201
app/badges/node_knockout.rb on lines 212..219

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

    const_set "Judge#{year}", Class.new(BadgeBase) {
      describe "KO Judge",
               skill:       'Node.js',
               description: "Official Judge of the #{year} Node Knockout",
               for:         "judging the #{year} Node Knockout.",
Severity: Major
Found in app/badges/node_knockout.rb and 7 other locations - About 25 mins to fix
app/badges/node_knockout.rb on lines 149..156
app/badges/node_knockout.rb on lines 167..174
app/badges/node_knockout.rb on lines 176..183
app/badges/node_knockout.rb on lines 185..192
app/badges/node_knockout.rb on lines 194..201
app/badges/node_knockout.rb on lines 203..210
app/badges/node_knockout.rb on lines 212..219

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

    const_set "MostVotes#{year}", Class.new(BadgeBase) {
      describe "KO Popular",
               skill:       'Node.js',
               description: "Won the most votes in the #{year} Node Knockout",
               for:         "winning the most votes in the #{year} Node Knockout",
Severity: Major
Found in app/badges/node_knockout.rb and 7 other locations - About 25 mins to fix
app/badges/node_knockout.rb on lines 149..156
app/badges/node_knockout.rb on lines 158..165
app/badges/node_knockout.rb on lines 167..174
app/badges/node_knockout.rb on lines 176..183
app/badges/node_knockout.rb on lines 194..201
app/badges/node_knockout.rb on lines 203..210
app/badges/node_knockout.rb on lines 212..219

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

    const_set "Contender#{year}", Class.new(BadgeBase) {
      describe "KO Contender",
               skill:       'Node.js',
               description: "Participated in #{year} Node Knockout",
               for:         "participating in #{year} Node Knockout.",
Severity: Major
Found in app/badges/node_knockout.rb and 7 other locations - About 25 mins to fix
app/badges/node_knockout.rb on lines 158..165
app/badges/node_knockout.rb on lines 167..174
app/badges/node_knockout.rb on lines 176..183
app/badges/node_knockout.rb on lines 185..192
app/badges/node_knockout.rb on lines 194..201
app/badges/node_knockout.rb on lines 203..210
app/badges/node_knockout.rb on lines 212..219

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

Severity
Category
Status
Source
Language