AyuntamientoMadrid/participacion

View on GitHub

Showing 1,085 of 1,085 total issues

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

      in_browser(:one) do
        click_link "Next"
        expect(page).to have_css ".pagination .current", text: "2"

        click_link "Previous"
Severity: Minor
Found in spec/system/budgets/investments_spec.rb and 1 other location - About 25 mins to fix
spec/system/budgets/investments_spec.rb on lines 465..472

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

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

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

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

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

Refactorings

Further Reading

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

    scenario "Access as manager is not authorized" do
      create(:manager, user: user)
      login_as(user)

      visit sdg_management_root_path
Severity: Major
Found in spec/system/sdg_management_spec.rb and 16 other locations - About 20 mins to fix
spec/system/admin_spec.rb on lines 15..22
spec/system/admin_spec.rb on lines 25..32
spec/system/admin_spec.rb on lines 35..42
spec/system/admin_spec.rb on lines 45..52
spec/system/moderation_spec.rb on lines 16..24
spec/system/moderation_spec.rb on lines 27..35
spec/system/moderation_spec.rb on lines 38..46
spec/system/moderation_spec.rb on lines 49..57
spec/system/officing_spec.rb on lines 17..25
spec/system/officing_spec.rb on lines 28..36
spec/system/officing_spec.rb on lines 51..59
spec/system/officing_spec.rb on lines 62..70
spec/system/valuation_spec.rb on lines 17..25
spec/system/valuation_spec.rb on lines 28..36
spec/system/valuation_spec.rb on lines 39..47
spec/system/valuation_spec.rb on lines 50..58

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

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

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

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

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

Refactorings

Further Reading

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

  scenario "Access as valuator is not authorized" do
    create(:valuator, user: user)
    login_as(user)
    visit admin_root_path

Severity: Major
Found in spec/system/admin_spec.rb and 16 other locations - About 20 mins to fix
spec/system/admin_spec.rb on lines 15..22
spec/system/admin_spec.rb on lines 35..42
spec/system/admin_spec.rb on lines 45..52
spec/system/moderation_spec.rb on lines 16..24
spec/system/moderation_spec.rb on lines 27..35
spec/system/moderation_spec.rb on lines 38..46
spec/system/moderation_spec.rb on lines 49..57
spec/system/officing_spec.rb on lines 17..25
spec/system/officing_spec.rb on lines 28..36
spec/system/officing_spec.rb on lines 51..59
spec/system/officing_spec.rb on lines 62..70
spec/system/sdg_management_spec.rb on lines 19..27
spec/system/valuation_spec.rb on lines 17..25
spec/system/valuation_spec.rb on lines 28..36
spec/system/valuation_spec.rb on lines 39..47
spec/system/valuation_spec.rb on lines 50..58

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

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

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

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

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

Refactorings

Further Reading

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

  scenario "Access as manager is not authorized" do
    create(:manager, user: user)
    login_as(user)
    visit admin_root_path

Severity: Major
Found in spec/system/admin_spec.rb and 16 other locations - About 20 mins to fix
spec/system/admin_spec.rb on lines 15..22
spec/system/admin_spec.rb on lines 25..32
spec/system/admin_spec.rb on lines 45..52
spec/system/moderation_spec.rb on lines 16..24
spec/system/moderation_spec.rb on lines 27..35
spec/system/moderation_spec.rb on lines 38..46
spec/system/moderation_spec.rb on lines 49..57
spec/system/officing_spec.rb on lines 17..25
spec/system/officing_spec.rb on lines 28..36
spec/system/officing_spec.rb on lines 51..59
spec/system/officing_spec.rb on lines 62..70
spec/system/sdg_management_spec.rb on lines 19..27
spec/system/valuation_spec.rb on lines 17..25
spec/system/valuation_spec.rb on lines 28..36
spec/system/valuation_spec.rb on lines 39..47
spec/system/valuation_spec.rb on lines 50..58

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

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

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

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

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

Refactorings

Further Reading

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

    scenario "Access as SDG manager is not authorized" do
      create(:sdg_manager, user: user)
      login_as(user)

      visit valuation_root_path
Severity: Major
Found in spec/system/valuation_spec.rb and 16 other locations - About 20 mins to fix
spec/system/admin_spec.rb on lines 15..22
spec/system/admin_spec.rb on lines 25..32
spec/system/admin_spec.rb on lines 35..42
spec/system/admin_spec.rb on lines 45..52
spec/system/moderation_spec.rb on lines 16..24
spec/system/moderation_spec.rb on lines 27..35
spec/system/moderation_spec.rb on lines 38..46
spec/system/moderation_spec.rb on lines 49..57
spec/system/officing_spec.rb on lines 17..25
spec/system/officing_spec.rb on lines 28..36
spec/system/officing_spec.rb on lines 51..59
spec/system/officing_spec.rb on lines 62..70
spec/system/sdg_management_spec.rb on lines 19..27
spec/system/valuation_spec.rb on lines 17..25
spec/system/valuation_spec.rb on lines 28..36
spec/system/valuation_spec.rb on lines 50..58

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

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

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

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

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

Refactorings

Further Reading

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

  scenario "Access as manager is not authorized" do
    create(:manager, user: user)
    login_as(user)

    visit officing_root_path
Severity: Major
Found in spec/system/officing_spec.rb and 16 other locations - About 20 mins to fix
spec/system/admin_spec.rb on lines 15..22
spec/system/admin_spec.rb on lines 25..32
spec/system/admin_spec.rb on lines 35..42
spec/system/admin_spec.rb on lines 45..52
spec/system/moderation_spec.rb on lines 16..24
spec/system/moderation_spec.rb on lines 27..35
spec/system/moderation_spec.rb on lines 38..46
spec/system/moderation_spec.rb on lines 49..57
spec/system/officing_spec.rb on lines 17..25
spec/system/officing_spec.rb on lines 51..59
spec/system/officing_spec.rb on lines 62..70
spec/system/sdg_management_spec.rb on lines 19..27
spec/system/valuation_spec.rb on lines 17..25
spec/system/valuation_spec.rb on lines 28..36
spec/system/valuation_spec.rb on lines 39..47
spec/system/valuation_spec.rb on lines 50..58

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

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

    it "can be compared against goals" do
      lesser_goal = build(:sdg_goal, code: "10")
      greater_goal = build(:sdg_goal, code: "11")

      expect(local_target).to be > lesser_goal
Severity: Major
Found in spec/models/sdg/local_target_spec.rb and 5 other locations - About 20 mins to fix
spec/models/sdg/goal_spec.rb on lines 43..48
spec/models/sdg/local_target_spec.rb on lines 82..87
spec/models/sdg/local_target_spec.rb on lines 90..95
spec/models/sdg/target_spec.rb on lines 96..101
spec/models/sdg/target_spec.rb on lines 121..126

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

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

    it "routes legislation annotations" do
      process = create(:legislation_process)
      draft_version = create(:legislation_draft_version, process: process)
      annotation = create(:legislation_annotation, draft_version: draft_version)

Severity: Minor
Found in spec/routing/polymorphic_routes_spec.rb and 3 other locations - About 20 mins to fix
spec/routing/polymorphic_routes_spec.rb on lines 83..89
spec/routing/polymorphic_routes_spec.rb on lines 126..132
spec/routing/polymorphic_routes_spec.rb on lines 145..151

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

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

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

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

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

Refactorings

Further Reading

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

  scenario "Access as moderator is not authorized" do
    create(:moderator, user: user)
    login_as(user)
    visit admin_root_path

Severity: Major
Found in spec/system/admin_spec.rb and 16 other locations - About 20 mins to fix
spec/system/admin_spec.rb on lines 25..32
spec/system/admin_spec.rb on lines 35..42
spec/system/admin_spec.rb on lines 45..52
spec/system/moderation_spec.rb on lines 16..24
spec/system/moderation_spec.rb on lines 27..35
spec/system/moderation_spec.rb on lines 38..46
spec/system/moderation_spec.rb on lines 49..57
spec/system/officing_spec.rb on lines 17..25
spec/system/officing_spec.rb on lines 28..36
spec/system/officing_spec.rb on lines 51..59
spec/system/officing_spec.rb on lines 62..70
spec/system/sdg_management_spec.rb on lines 19..27
spec/system/valuation_spec.rb on lines 17..25
spec/system/valuation_spec.rb on lines 28..36
spec/system/valuation_spec.rb on lines 39..47
spec/system/valuation_spec.rb on lines 50..58

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

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

    it "can be compared against local targets" do
      lesser_local_target = build(:sdg_local_target, code: "9.B.12")
      greater_local_target = build(:sdg_local_target, code: "10.1.4")

      expect(goal).to be > lesser_local_target
Severity: Major
Found in spec/models/sdg/goal_spec.rb and 5 other locations - About 20 mins to fix
spec/models/sdg/local_target_spec.rb on lines 82..87
spec/models/sdg/local_target_spec.rb on lines 90..95
spec/models/sdg/local_target_spec.rb on lines 106..111
spec/models/sdg/target_spec.rb on lines 96..101
spec/models/sdg/target_spec.rb on lines 121..126

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

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

      it "compares using the goal first" do
        lesser_local_target = build(:sdg_local_target, code: "2.1.1")
        greater_local_target = build(:sdg_local_target, code: "11.1.2")

        expect(target).to be > lesser_local_target
Severity: Major
Found in spec/models/sdg/target_spec.rb and 5 other locations - About 20 mins to fix
spec/models/sdg/goal_spec.rb on lines 43..48
spec/models/sdg/local_target_spec.rb on lines 82..87
spec/models/sdg/local_target_spec.rb on lines 90..95
spec/models/sdg/local_target_spec.rb on lines 106..111
spec/models/sdg/target_spec.rb on lines 121..126

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

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

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

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

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

Refactorings

Further Reading

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

    scenario "Access as moderator is not authorized" do
      create(:moderator, user: user)
      login_as(user)

      visit valuation_root_path
Severity: Major
Found in spec/system/valuation_spec.rb and 16 other locations - About 20 mins to fix
spec/system/admin_spec.rb on lines 15..22
spec/system/admin_spec.rb on lines 25..32
spec/system/admin_spec.rb on lines 35..42
spec/system/admin_spec.rb on lines 45..52
spec/system/moderation_spec.rb on lines 16..24
spec/system/moderation_spec.rb on lines 27..35
spec/system/moderation_spec.rb on lines 38..46
spec/system/moderation_spec.rb on lines 49..57
spec/system/officing_spec.rb on lines 17..25
spec/system/officing_spec.rb on lines 28..36
spec/system/officing_spec.rb on lines 51..59
spec/system/officing_spec.rb on lines 62..70
spec/system/sdg_management_spec.rb on lines 19..27
spec/system/valuation_spec.rb on lines 28..36
spec/system/valuation_spec.rb on lines 39..47
spec/system/valuation_spec.rb on lines 50..58

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

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

    it "routes milestones for resources with hierarchy" do
      budget = create(:budget)
      investment = create(:budget_investment, budget: budget)
      milestone = create(:milestone, milestoneable: investment)

Severity: Minor
Found in spec/routing/polymorphic_routes_spec.rb and 3 other locations - About 20 mins to fix
spec/routing/polymorphic_routes_spec.rb on lines 46..52
spec/routing/polymorphic_routes_spec.rb on lines 83..89
spec/routing/polymorphic_routes_spec.rb on lines 145..151

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

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

    it "routes progress_bars for resources with hierarchy" do
      budget = create(:budget)
      investment = create(:budget_investment, budget: budget)
      progress_bar = create(:progress_bar, progressable: investment)

Severity: Minor
Found in spec/routing/polymorphic_routes_spec.rb and 3 other locations - About 20 mins to fix
spec/routing/polymorphic_routes_spec.rb on lines 46..52
spec/routing/polymorphic_routes_spec.rb on lines 83..89
spec/routing/polymorphic_routes_spec.rb on lines 126..132

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

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

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

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

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

Refactorings

Further Reading

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

  scenario "Access as poll officer is not authorized" do
    create(:poll_officer, user: user)
    login_as(user)

    visit moderation_root_path
Severity: Major
Found in spec/system/moderation_spec.rb and 16 other locations - About 20 mins to fix
spec/system/admin_spec.rb on lines 15..22
spec/system/admin_spec.rb on lines 25..32
spec/system/admin_spec.rb on lines 35..42
spec/system/admin_spec.rb on lines 45..52
spec/system/moderation_spec.rb on lines 16..24
spec/system/moderation_spec.rb on lines 27..35
spec/system/moderation_spec.rb on lines 38..46
spec/system/officing_spec.rb on lines 17..25
spec/system/officing_spec.rb on lines 28..36
spec/system/officing_spec.rb on lines 51..59
spec/system/officing_spec.rb on lines 62..70
spec/system/sdg_management_spec.rb on lines 19..27
spec/system/valuation_spec.rb on lines 17..25
spec/system/valuation_spec.rb on lines 28..36
spec/system/valuation_spec.rb on lines 39..47
spec/system/valuation_spec.rb on lines 50..58

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

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

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

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

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

Refactorings

Further Reading

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

  scenario "Access as moderator is not authorized" do
    create(:moderator, user: user)
    login_as(user)

    visit officing_root_path
Severity: Major
Found in spec/system/officing_spec.rb and 16 other locations - About 20 mins to fix
spec/system/admin_spec.rb on lines 15..22
spec/system/admin_spec.rb on lines 25..32
spec/system/admin_spec.rb on lines 35..42
spec/system/admin_spec.rb on lines 45..52
spec/system/moderation_spec.rb on lines 16..24
spec/system/moderation_spec.rb on lines 27..35
spec/system/moderation_spec.rb on lines 38..46
spec/system/moderation_spec.rb on lines 49..57
spec/system/officing_spec.rb on lines 28..36
spec/system/officing_spec.rb on lines 51..59
spec/system/officing_spec.rb on lines 62..70
spec/system/sdg_management_spec.rb on lines 19..27
spec/system/valuation_spec.rb on lines 17..25
spec/system/valuation_spec.rb on lines 28..36
spec/system/valuation_spec.rb on lines 39..47
spec/system/valuation_spec.rb on lines 50..58

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

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

    it "compares using the target first" do
      lesser_local_target = create(:sdg_local_target, code: "10.A.1")
      greater_local_target = create(:sdg_local_target, code: "11.1.1")

      expect(local_target).to be > lesser_local_target
Severity: Major
Found in spec/models/sdg/local_target_spec.rb and 5 other locations - About 20 mins to fix
spec/models/sdg/goal_spec.rb on lines 43..48
spec/models/sdg/local_target_spec.rb on lines 90..95
spec/models/sdg/local_target_spec.rb on lines 106..111
spec/models/sdg/target_spec.rb on lines 96..101
spec/models/sdg/target_spec.rb on lines 121..126

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

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

    it "compares using the local target code when the target is the same" do
      lesser_local_target = create(:sdg_local_target, code: "10.B.9")
      greater_local_target = create(:sdg_local_target, code: "10.B.11")

      expect(local_target).to be > lesser_local_target
Severity: Major
Found in spec/models/sdg/local_target_spec.rb and 5 other locations - About 20 mins to fix
spec/models/sdg/goal_spec.rb on lines 43..48
spec/models/sdg/local_target_spec.rb on lines 82..87
spec/models/sdg/local_target_spec.rb on lines 106..111
spec/models/sdg/target_spec.rb on lines 96..101
spec/models/sdg/target_spec.rb on lines 121..126

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

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

    it "routes budget headings" do
      budget = create(:budget)
      group = create(:budget_group, budget: budget)
      heading = create(:budget_heading, group: group)

Severity: Minor
Found in spec/routing/polymorphic_routes_spec.rb and 3 other locations - About 20 mins to fix
spec/routing/polymorphic_routes_spec.rb on lines 46..52
spec/routing/polymorphic_routes_spec.rb on lines 126..132
spec/routing/polymorphic_routes_spec.rb on lines 145..151

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

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

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

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

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

Refactorings

Further Reading

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

  scenario "Error messages" do
    author = create(:user)
    proposal = create(:proposal, author: author)

    login_as(author)
Severity: Minor
Found in spec/system/direct_messages_spec.rb and 1 other location - About 20 mins to fix
spec/system/proposal_notifications_spec.rb on lines 369..378

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

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