AyuntamientoMadrid/participacion

View on GitHub

Showing 862 of 1,056 total issues

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

        within("#sidebar") do
          expect(page).not_to have_content "More bridges"
          expect(page).to have_content "OpenStreetMap"
          expect(page).to have_content "New Block"
          expect(page).to have_css ".map-icon", visible: :all, count: 2
Severity: Minor
Found in spec/system/budgets/ballots_spec.rb and 1 other location - About 25 mins to fix
spec/system/budgets/ballots_spec.rb on lines 192..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 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 3 locations. Consider refactoring.
Open

      within("#groups_and_headings") do
        expect(page).to have_content "New group"
        expect(page).to have_content "New heading"
        expect(page).to have_content "€10,000"
        expect(page).to have_content "Other new heading"
Severity: Minor
Found in spec/system/budgets/budgets_spec.rb and 2 other locations - About 25 mins to fix
spec/system/admin/audits_spec.rb on lines 22..27
spec/system/budget_polls/budgets_spec.rb on lines 40..45

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

      it "works OK when both tags are present for debates" do
        create(:debate).tags = [uppercase_tag]
        create(:debate).tags = [lowercase_tag]

        response = execute("{ tags { edges { node { name } } } }")
Severity: Minor
Found in spec/graphql/types/query_type_spec.rb and 1 other location - About 25 mins to fix
spec/graphql/types/query_type_spec.rb on lines 399..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 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 2 locations. Consider refactoring.
Open

        within("#sidebar") do
          expect(page).to have_content "More bridges"
          expect(page).to have_content "OpenStreetMap"
          expect(page).to have_content "New Block"
          expect(page).to have_css ".map-icon", visible: :all, count: 2
Severity: Minor
Found in spec/system/budgets/ballots_spec.rb and 1 other location - About 25 mins to fix
spec/system/budgets/ballots_spec.rb on lines 203..208

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

    it "returns uniq list of investments milestone_tags" do
      investment1.milestone_tag_list = "tag1"
      investment1.save!
      investment2.milestone_tag_list = "tag1"
      investment2.save!
Severity: Minor
Found in spec/models/budget_spec.rb and 1 other location - About 25 mins to fix
spec/models/budget_spec.rb on lines 451..459

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

      in_browser(:two) 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 455..462

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

    it "returns text help when postal_code is required" do
      Setting["remote_census.request.date_of_birth"] = nil

      text_help_1 = "To verify a user, your application needs: " \
                    "Document number and Postal Code"
Severity: Minor
Found in spec/helpers/signature_sheets_helper_spec.rb and 1 other location - About 25 mins to fix
spec/helpers/signature_sheets_helper_spec.rb on lines 26..37

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

  describe "#budget_valuators" do
    it "destroys relation with valuators when destroying the budget" do
      budget = create(:budget, valuators: [create(:valuator)])

      budget.destroy!
Severity: Minor
Found in spec/models/budget_spec.rb and 1 other location - About 25 mins to fix
spec/models/budget_spec.rb on lines 491..498

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

    it "returns tags only for winner investments" do
      investment1.milestone_tag_list = "tag1"
      investment1.save!
      investment3.milestone_tag_list = "tag2"
      investment3.save!
Severity: Minor
Found in spec/models/budget_spec.rb and 1 other location - About 25 mins to fix
spec/models/budget_spec.rb on lines 440..448

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

    it "returns text help when date_of_birth is required" do
      Setting["remote_census.request.postal_code"] = nil

      text_help_1 = "To verify a user, your application needs: " \
                    "Document number, Day of birth (dd/mm/yyyy)"
Severity: Minor
Found in spec/helpers/signature_sheets_helper_spec.rb and 1 other location - About 25 mins to fix
spec/helpers/signature_sheets_helper_spec.rb on lines 40..51

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

  describe "#budget_administrators" do
    it "destroys relation with administrators when destroying the budget" do
      budget = create(:budget, administrators: [create(:administrator)])

      budget.destroy!
Severity: Minor
Found in spec/models/budget_spec.rb and 1 other location - About 25 mins to fix
spec/models/budget_spec.rb on lines 502..509

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

    it "quotes the background image filename so it works with filenames with brackets" do
      budget.update!(image: create(:image, attachment: fixture_file_upload("clippy(with_brackets).jpg")))

      render_inline Budgets::BudgetComponent.new(budget)

Severity: Minor
Found in spec/components/budgets/budget_component_spec.rb and 1 other location - About 25 mins to fix
spec/components/budgets/budget_component_spec.rb on lines 69..75

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

  scenario "Access as a valuator is not authorized" do
    create(:valuator, 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 28..36
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 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 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 17 locations. Consider refactoring.
Open

  scenario "Access as SDG manager is not authorized" do
    create(:sdg_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 35..42
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 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

Severity
Category
Status
Source
Language