AyuntamientoMadrid/participacion

View on GitHub

Showing 862 of 1,056 total issues

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

  describe "moderator?" do
    it "is false when the user is not a moderator" do
      expect(subject.moderator?).to be false
    end

Severity: Major
Found in spec/models/user_spec.rb and 5 other locations - About 25 mins to fix
spec/models/user_spec.rb on lines 132..140
spec/models/user_spec.rb on lines 156..164
spec/models/user_spec.rb on lines 168..176
spec/models/user_spec.rb on lines 180..188
spec/models/user_spec.rb on lines 192..200

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

  describe "sdg_manager?" do
    it "is false when the user is not a sdg manager" do
      expect(subject.sdg_manager?).to be false
    end

Severity: Major
Found in spec/models/user_spec.rb and 5 other locations - About 25 mins to fix
spec/models/user_spec.rb on lines 132..140
spec/models/user_spec.rb on lines 144..152
spec/models/user_spec.rb on lines 156..164
spec/models/user_spec.rb on lines 168..176
spec/models/user_spec.rb on lines 192..200

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

  describe "valuator?" do
    it "is false when the user is not a valuator" do
      expect(subject.valuator?).to be false
    end

Severity: Major
Found in spec/models/user_spec.rb and 5 other locations - About 25 mins to fix
spec/models/user_spec.rb on lines 132..140
spec/models/user_spec.rb on lines 144..152
spec/models/user_spec.rb on lines 168..176
spec/models/user_spec.rb on lines 180..188
spec/models/user_spec.rb on lines 192..200

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

  describe "manager?" do
    it "is false when the user is not a manager" do
      expect(subject.manager?).to be false
    end

Severity: Major
Found in spec/models/user_spec.rb and 5 other locations - About 25 mins to fix
spec/models/user_spec.rb on lines 132..140
spec/models/user_spec.rb on lines 144..152
spec/models/user_spec.rb on lines 156..164
spec/models/user_spec.rb on lines 180..188
spec/models/user_spec.rb on lines 192..200

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

  describe "poll_officer?" do
    it "is false when the user is not a poll officer" do
      expect(subject.poll_officer?).to be false
    end

Severity: Major
Found in spec/models/user_spec.rb and 5 other locations - About 25 mins to fix
spec/models/user_spec.rb on lines 132..140
spec/models/user_spec.rb on lines 144..152
spec/models/user_spec.rb on lines 156..164
spec/models/user_spec.rb on lines 168..176
spec/models/user_spec.rb on lines 180..188

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

    it "is shown when the valuating phase is over" do
      budget = create(:budget, :finished)
      create(:budget_investment, :visible_to_valuators, budget: budget, valuators: [valuator])

      render_inline Valuation::Budgets::RowComponent.new(budget: budget)
Severity: Minor
Found in spec/components/valuation/budgets/row_component_spec.rb and 3 other locations - About 25 mins to fix
spec/components/valuation/budgets/row_component_spec.rb on lines 62..68
spec/components/valuation/budgets/row_component_spec.rb on lines 93..99
spec/components/valuation/budgets/row_component_spec.rb on lines 111..117

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

  describe "#debate" do
    it "does not find debates that are not public" do
      allow(Debate).to receive(:public_for_api).and_return(Debate.none)
      debate = create(:debate)

Severity: Major
Found in spec/graphql/types/query_type_spec.rb and 4 other locations - About 25 mins to fix
spec/graphql/types/query_type_spec.rb on lines 299..307
spec/graphql/types/query_type_spec.rb on lines 321..329
spec/graphql/types/query_type_spec.rb on lines 368..376
spec/graphql/types/query_type_spec.rb on lines 463..471

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

        expect(page).to have_content "No supports"

        click_button "Support"

        expect(page).to have_content "1 support"
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 1275..1285

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

describe Moderation::DebatesController do
  before { sign_in(create(:moderator).user) }

  describe "GET index" do
    it "raises an exception when the feature is disabled" do
Severity: Minor
Found in spec/controllers/moderation/debates_controller_spec.rb and 2 other locations - About 25 mins to fix
spec/controllers/moderation/proposals_controller_spec.rb on lines 3..10
spec/controllers/valuation/budgets_controller_spec.rb on lines 3..10

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

describe Valuation::BudgetsController do
  before { sign_in(create(:valuator).user) }

  describe "GET index" do
    it "raises an exception when the feature is disabled" do
Severity: Minor
Found in spec/controllers/valuation/budgets_controller_spec.rb and 2 other locations - About 25 mins to fix
spec/controllers/moderation/debates_controller_spec.rb on lines 3..10
spec/controllers/moderation/proposals_controller_spec.rb on lines 3..10

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

    it "is invalid if draft_end_date is before draft_start_date" do
      process = build(:legislation_process, draft_start_date: Date.current,
                                            draft_end_date: Date.current - 1.day)
      expect(process).not_to be_valid
      expect(process.errors.messages[:draft_end_date])
Severity: Minor
Found in spec/models/legislation/process_spec.rb and 3 other locations - About 25 mins to fix
spec/models/legislation/process_spec.rb on lines 160..164
spec/models/legislation/process_spec.rb on lines 179..184
spec/models/legislation/process_spec.rb on lines 201..206

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

    8.times do |i|
      user = create(:user, :verified)
      Vote.create!(
        votable: proposal,
        voter: user,
Severity: Minor
Found in spec/requests/dashboard/successful_supports_spec.rb and 1 other location - About 25 mins to fix
spec/requests/dashboard/group_supports_spec.rb on lines 8..12

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

  describe "#user" do
    it "does not find users that are not public" do
      allow(User).to receive(:public_for_api).and_return(User.none)
      user = create(:user)

Severity: Major
Found in spec/graphql/types/query_type_spec.rb and 4 other locations - About 25 mins to fix
spec/graphql/types/query_type_spec.rb on lines 263..271
spec/graphql/types/query_type_spec.rb on lines 299..307
spec/graphql/types/query_type_spec.rb on lines 321..329
spec/graphql/types/query_type_spec.rb on lines 368..376

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

    it "is not shown when the assigned investments aren't visible to valuators" do
      budget = create(:budget, :valuating)
      create(:budget_investment, :invisible_to_valuators, budget: budget, valuators: [valuator])

      render_inline Valuation::Budgets::RowComponent.new(budget: budget)
Severity: Minor
Found in spec/components/valuation/budgets/row_component_spec.rb and 3 other locations - About 25 mins to fix
spec/components/valuation/budgets/row_component_spec.rb on lines 62..68
spec/components/valuation/budgets/row_component_spec.rb on lines 111..117
spec/components/valuation/budgets/row_component_spec.rb on lines 120..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 30.

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

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

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

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

Refactorings

Further Reading

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

    it "is not shown when the budget hasn't reached the valuating phase" do
      budget = create(:budget, :accepting)
      create(:budget_investment, :visible_to_valuators, budget: budget, valuators: [valuator])

      render_inline Valuation::Budgets::RowComponent.new(budget: budget)
Severity: Minor
Found in spec/components/valuation/budgets/row_component_spec.rb and 3 other locations - About 25 mins to fix
spec/components/valuation/budgets/row_component_spec.rb on lines 62..68
spec/components/valuation/budgets/row_component_spec.rb on lines 93..99
spec/components/valuation/budgets/row_component_spec.rb on lines 120..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 30.

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

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

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

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

Refactorings

Further Reading

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

    it "is invalid if debate_end_date is before debate_start_date" do
      process = build(:legislation_process, debate_start_date: Date.current,
                                            debate_end_date: Date.current - 1.day)
      expect(process).not_to be_valid
      expect(process.errors.messages[:debate_end_date])
Severity: Minor
Found in spec/models/legislation/process_spec.rb and 3 other locations - About 25 mins to fix
spec/models/legislation/process_spec.rb on lines 160..164
spec/models/legislation/process_spec.rb on lines 193..198
spec/models/legislation/process_spec.rb on lines 201..206

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

      within(".account-info") do
        expect(page).to have_content "Identified as"
        expect(page).to have_content user.username.to_s
        expect(page).to have_content user.email.to_s
        expect(page).to have_content user.document_number.to_s
Severity: Minor
Found in spec/system/management/proposals_spec.rb and 1 other location - About 25 mins to fix
spec/system/management/proposals_spec.rb on lines 127..131

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

    it "is shown when the valuator has visible investments assigned in the valuating phase" do
      budget = create(:budget, :valuating)
      create(:budget_investment, :visible_to_valuators, budget: budget, valuators: [valuator])

      render_inline Valuation::Budgets::RowComponent.new(budget: budget)
Severity: Minor
Found in spec/components/valuation/budgets/row_component_spec.rb and 3 other locations - About 25 mins to fix
spec/components/valuation/budgets/row_component_spec.rb on lines 93..99
spec/components/valuation/budgets/row_component_spec.rb on lines 111..117
spec/components/valuation/budgets/row_component_spec.rb on lines 120..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 30.

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

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

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

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

Refactorings

Further Reading

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

  describe "#proposal" do
    it "does not find proposals that are not public" do
      allow(Proposal).to receive(:public_for_api).and_return(Proposal.none)
      proposal = create(:proposal)

Severity: Major
Found in spec/graphql/types/query_type_spec.rb and 4 other locations - About 25 mins to fix
spec/graphql/types/query_type_spec.rb on lines 263..271
spec/graphql/types/query_type_spec.rb on lines 321..329
spec/graphql/types/query_type_spec.rb on lines 368..376
spec/graphql/types/query_type_spec.rb on lines 463..471

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

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

    it "is invalid if end_date is before start_date" do
      process = build(:legislation_process, start_date: Date.current,
                                            end_date: Date.current - 1.day)
      expect(process).not_to be_valid
      expect(process.errors.messages[:end_date]).to include("must be on or after the start date")
Severity: Minor
Found in spec/models/legislation/process_spec.rb and 3 other locations - About 25 mins to fix
spec/models/legislation/process_spec.rb on lines 179..184
spec/models/legislation/process_spec.rb on lines 193..198
spec/models/legislation/process_spec.rb on lines 201..206

Duplicated Code

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

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

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

Tuning

This issue has a mass of 30.

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

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

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

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

Refactorings

Further Reading

Severity
Category
Status
Source
Language