AyuntamientoMadrid/participacion

View on GitHub

Showing 1,085 of 1,085 total issues

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

    it "switches to another version without js", :no_js do
      visit legislation_process_draft_version_changes_path(process, original)
      expect(page).to have_content("Changes for first version")

      select("Current")
Severity: Minor
Found in spec/system/legislation/draft_versions_spec.rb and 2 other locations - About 20 mins to fix
spec/system/legislation/draft_versions_spec.rb on lines 54..62
spec/system/legislation/draft_versions_spec.rb on lines 385..393

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 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 39..47

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 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 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 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 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 goals" do
      lesser_goal = build(:sdg_goal, code: "9")
      greater_goal = build(:sdg_goal, code: "11")

      expect(target).to be > lesser_goal
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 96..101

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

      scenario "without js", :no_js do
        visit legislation_process_draft_version_annotations_path(process, original)
        expect(page).to have_content("quote for version 1")

        select("Current")
Severity: Minor
Found in spec/system/legislation/draft_versions_spec.rb and 2 other locations - About 20 mins to fix
spec/system/legislation/draft_versions_spec.rb on lines 54..62
spec/system/legislation/draft_versions_spec.rb on lines 158..166

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 an administrator is not authorized" do
    create(:administrator, 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 51..59
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 3 locations. Consider refactoring.
Open

    it "dynamically validates the valid origins" do
      stub_const("#{Poll::PartialResult}::VALID_ORIGINS", %w[custom])

      expect(build(:poll_partial_result, origin: "custom")).to be_valid
      expect(build(:poll_partial_result, origin: "web")).not_to be_valid
Severity: Minor
Found in spec/models/poll/partial_result_spec.rb and 2 other locations - About 20 mins to fix
spec/models/poll/recount_spec.rb on lines 5..9
spec/models/poll/voter_spec.rb on lines 121..125

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

    it "switches to another version without js", :no_js do
      visit legislation_process_draft_version_path(process, original)
      expect(page).to have_content("Original version")

      select("Current")
Severity: Minor
Found in spec/system/legislation/draft_versions_spec.rb and 2 other locations - About 20 mins to fix
spec/system/legislation/draft_versions_spec.rb on lines 158..166
spec/system/legislation/draft_versions_spec.rb on lines 385..393

Duplicated Code

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

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

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

Tuning

This issue has a mass of 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 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 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 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 2 locations. Consider refactoring.
Open

    scenario "Should not update document cached_attachment field after invalid file upload" do
      do_login_for user_to_login, management: management
      visit send(path, arguments)

      documentable_attach_new_file(file_fixture("logo_header.gif"), false)
Severity: Minor
Found in spec/shared/system/nested_documentable.rb and 1 other location - About 20 mins to fix
spec/shared/system/nested_imageable.rb on lines 104..112

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

  def create
    @investment.register_selection(managed_user)

    respond_to do |format|
      format.html do
app/controllers/budgets/investments/votes_controller.rb on lines 11..20

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

      def create
        @investment.register_selection(current_user)

        respond_to do |format|
          format.html do
Severity: Minor
Found in app/controllers/budgets/investments/votes_controller.rb and 1 other location - About 20 mins to fix
app/controllers/management/budgets/investments/votes_controller.rb on lines 6..15

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/proposal_notifications_spec.rb and 1 other location - About 20 mins to fix
spec/system/direct_messages_spec.rb on lines 81..90

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

    it "dynamically validates the valid origins" do
      stub_const("#{Poll::Recount}::VALID_ORIGINS", %w[custom])

      expect(build(:poll_recount, origin: "custom")).to be_valid
      expect(build(:poll_recount, origin: "web")).not_to be_valid
Severity: Minor
Found in spec/models/poll/recount_spec.rb and 2 other locations - About 20 mins to fix
spec/models/poll/partial_result_spec.rb on lines 18..22
spec/models/poll/voter_spec.rb on lines 121..125

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

      it "returns census api response when it's available and census api response is valid" do
        census_api_response = CensusApi::Response.new(valid_body)
        allow_any_instance_of(CensusApi).to receive(:call).and_return(census_api_response)

        response = api.call(1, "12345678A", nil, nil)
Severity: Minor
Found in spec/lib/census_caller_spec.rb and 1 other location - About 20 mins to fix
spec/lib/census_caller_spec.rb on lines 60..67

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

    it "redirects to management root path if user is admin" do
      user = create(:administrator).user
      sign_in user
      get :create
      expect(response).to be_redirect
Severity: Minor
Found in spec/controllers/management/sessions_controller_spec.rb and 1 other location - About 20 mins to fix
spec/controllers/management/sessions_controller_spec.rb on lines 35..40

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