spec/features/budgets/investments_spec.rb

Summary

Maintainability
F
1 wk
Test Coverage

File investments_spec.rb has 1317 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'rails_helper'
require 'sessions_helper'

feature 'Budget Investments' do

Severity: Major
Found in spec/features/budgets/investments_spec.rb - About 3 days to fix

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

            xscenario "City councillor", :js do
              ana = create :user, official_level: 4
              john = create :user, official_level: 5
    
              bdgt_invest1 = create(:budget_investment, heading: heading, author: ana)
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 4 other locations - About 2 hrs to fix
    spec/features/budgets/investments_spec.rb on lines 147..166
    spec/features/budgets/investments_spec.rb on lines 170..189
    spec/features/budgets/investments_spec.rb on lines 193..212
    spec/features/budgets/investments_spec.rb on lines 239..258

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

    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

            xscenario "General director", :js do
              ana = create :user, official_level: 3
              john = create :user, official_level: 4
    
              bdgt_invest1 = create(:budget_investment, heading: heading, author: ana)
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 4 other locations - About 2 hrs to fix
    spec/features/budgets/investments_spec.rb on lines 147..166
    spec/features/budgets/investments_spec.rb on lines 170..189
    spec/features/budgets/investments_spec.rb on lines 216..235
    spec/features/budgets/investments_spec.rb on lines 239..258

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

    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

            xscenario "Public employee", :js do
              ana = create :user, official_level: 1
              john = create :user, official_level: 2
    
              bdgt_invest1 = create(:budget_investment, heading: heading, author: ana)
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 4 other locations - About 2 hrs to fix
    spec/features/budgets/investments_spec.rb on lines 170..189
    spec/features/budgets/investments_spec.rb on lines 193..212
    spec/features/budgets/investments_spec.rb on lines 216..235
    spec/features/budgets/investments_spec.rb on lines 239..258

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

    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

            xscenario "Mayoress", :js do
              ana = create :user, official_level: 5
              john = create :user, official_level: 4
    
              bdgt_invest1 = create(:budget_investment, heading: heading, author: ana)
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 4 other locations - About 2 hrs to fix
    spec/features/budgets/investments_spec.rb on lines 147..166
    spec/features/budgets/investments_spec.rb on lines 170..189
    spec/features/budgets/investments_spec.rb on lines 193..212
    spec/features/budgets/investments_spec.rb on lines 216..235

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

    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

            xscenario "Municipal Organization", :js do
              ana = create :user, official_level: 2
              john = create :user, official_level: 3
    
              bdgt_invest1 = create(:budget_investment, heading: heading, author: ana)
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 4 other locations - About 2 hrs to fix
    spec/features/budgets/investments_spec.rb on lines 147..166
    spec/features/budgets/investments_spec.rb on lines 193..212
    spec/features/budgets/investments_spec.rb on lines 216..235
    spec/features/budgets/investments_spec.rb on lines 239..258

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

    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

              scenario "Last week", :js do
                bdgt_invest1 = create(:budget_investment, heading: heading,created_at: 1.day.ago)
                bdgt_invest2 = create(:budget_investment, heading: heading,created_at: 5.days.ago)
                bdgt_invest3 = create(:budget_investment, heading: heading,created_at: 8.days.ago)
    
    
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 3 other locations - About 1 hr to fix
    spec/features/budgets/investments_spec.rb on lines 268..284
    spec/features/budgets/investments_spec.rb on lines 308..324
    spec/features/budgets/investments_spec.rb on lines 328..344

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

    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

              scenario "Last day", :js do
                bdgt_invest1 = create(:budget_investment, heading: heading,created_at: 1.minute.ago)
                bdgt_invest2 = create(:budget_investment, heading: heading,created_at: 1.hour.ago)
                bdgt_invest3 = create(:budget_investment, heading: heading,created_at: 2.days.ago)
    
    
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 3 other locations - About 1 hr to fix
    spec/features/budgets/investments_spec.rb on lines 288..304
    spec/features/budgets/investments_spec.rb on lines 308..324
    spec/features/budgets/investments_spec.rb on lines 328..344

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

    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

              scenario "Last year", :js do
                bdgt_invest1 = create(:budget_investment, heading: heading,created_at: 300.days.ago)
                bdgt_invest2 = create(:budget_investment, heading: heading,created_at: 350.days.ago)
                bdgt_invest3 = create(:budget_investment, heading: heading,created_at: 370.days.ago)
    
    
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 3 other locations - About 1 hr to fix
    spec/features/budgets/investments_spec.rb on lines 268..284
    spec/features/budgets/investments_spec.rb on lines 288..304
    spec/features/budgets/investments_spec.rb on lines 308..324

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

    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

              scenario "Last month", :js do
                bdgt_invest1 = create(:budget_investment, heading: heading,created_at: 10.days.ago)
                bdgt_invest2 = create(:budget_investment, heading: heading,created_at: 20.days.ago)
                bdgt_invest3 = create(:budget_investment, heading: heading,created_at: 33.days.ago)
    
    
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 3 other locations - About 1 hr to fix
    spec/features/budgets/investments_spec.rb on lines 268..284
    spec/features/budgets/investments_spec.rb on lines 288..304
    spec/features/budgets/investments_spec.rb on lines 328..344

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

    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 'No found suggestions', :js do
            login_as(author)
    
            %w(first second third fourth fifth sixth).each do |ordinal|
              create(factory, title: "#{ordinal.titleize} #{factory}, has search term", budget: budget)
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 1 other location - About 1 hr to fix
    spec/features/budgets/investments_spec.rb on lines 819..830

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

    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 "Don't show suggestions from a different budget", :js do
            login_as(author)
    
            %w(first second third fourth fifth sixth).each do |ordinal|
              create(factory, title: "#{ordinal.titleize} #{factory}, has search term", budget: budget)
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 1 other location - About 1 hr to fix
    spec/features/budgets/investments_spec.rb on lines 804..815

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

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

      scenario "Show (unfeasible budget investment with valuation not finished)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 3 other locations - About 50 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1093..1108
    spec/features/budgets/investments_spec.rb on lines 1163..1178
    spec/features/budgets/investments_spec.rb on lines 1198..1213

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

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

      scenario "Show (unfeasible budget investment with valuation not finished)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 3 other locations - About 50 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1075..1090
    spec/features/budgets/investments_spec.rb on lines 1093..1108
    spec/features/budgets/investments_spec.rb on lines 1198..1213

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

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

      scenario "Show (unfeasible budget investment with valuation not finished)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 3 other locations - About 50 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1075..1090
    spec/features/budgets/investments_spec.rb on lines 1093..1108
    spec/features/budgets/investments_spec.rb on lines 1163..1178

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

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

      scenario "Show (unfeasible budget investment with valuation not finished)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 3 other locations - About 50 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1075..1090
    spec/features/budgets/investments_spec.rb on lines 1163..1178
    spec/features/budgets/investments_spec.rb on lines 1198..1213

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

    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 "Show (winner budget investment)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 1 other location - About 40 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1128..1143

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

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

      scenario "Show (not selected budget investment)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 2 other locations - About 40 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1058..1072
    spec/features/budgets/investments_spec.rb on lines 1181..1195

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

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

      scenario "Show (not selected budget investment)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 2 other locations - About 40 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1058..1072
    spec/features/budgets/investments_spec.rb on lines 1146..1160

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

    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 "Show (winner budget investment)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 1 other location - About 40 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1040..1055

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

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

      scenario "Show (not selected budget investment)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 2 other locations - About 40 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1146..1160
    spec/features/budgets/investments_spec.rb on lines 1181..1195

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

    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 "Show (selected budget investment)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 1 other location - About 35 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1023..1037

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

    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

              budget.update(phase: phase)
              visit budget_investment_path(budget_id: budget.id, id: investment.id)
    
              expect(page).not_to have_content(investment.formatted_price)
              expect(page).not_to have_content(investment.price_explanation)
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 1 other location - About 35 mins to fix
    spec/features/budgets/investments_spec.rb on lines 907..915

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

    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

          within("#budget-investments") do
            expect(page).to have_css('.budget-investment', count: 1)
    
            expect(page).to have_content(investment1.title)
            expect(page).not_to have_content(investment2.title)
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 3 other locations - About 35 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1630..1636
    spec/features/tags_spec.rb on lines 29..34
    spec/features/tags_spec.rb on lines 39..44

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

    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 "Show (selected budget investment)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 1 other location - About 35 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1111..1125

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

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

              within "#js-advanced-search" do
                expect(page).to have_select('advanced_search[date_min]', selected: 'Customized')
                expect(page).to have_selector("input[name='advanced_search[date_min]'][value*='#{7.days.ago.strftime('%d/%m/%Y')}']")
                expect(page).to have_selector("input[name='advanced_search[date_max]'][value*='#{1.day.ago.strftime('%d/%m/%Y')}']")
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 2 other locations - About 35 mins to fix
    spec/features/debates_spec.rb on lines 893..896
    spec/features/proposals_spec.rb on lines 1347..1350

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

    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

              budget.update(phase: phase)
              visit budget_investment_path(budget_id: budget.id, id: investment.id)
    
              expect(page).not_to have_content(investment.formatted_price)
              expect(page).not_to have_content(investment.price_explanation)
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 1 other location - About 35 mins to fix
    spec/features/budgets/investments_spec.rb on lines 928..936

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

    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

          within("#budget-investments") do
            expect(page).to have_css('.budget-investment', count: 1)
    
            expect(page).to have_content(investment1.title)
            expect(page).not_to have_content(investment2.title)
    Severity: Major
    Found in spec/features/budgets/investments_spec.rb and 3 other locations - About 35 mins to fix
    spec/features/budgets/investments_spec.rb on lines 471..477
    spec/features/tags_spec.rb on lines 29..34
    spec/features/tags_spec.rb on lines 39..44

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

    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 'Ballot is not visible' do
          login_as(author)
    
          visit budget_investments_path(budget, heading_id: heading.id)
    
    
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 1 other location - About 25 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1610..1618

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 31.

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

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

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

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

    Refactorings

    Further Reading

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

        scenario 'Ballot is visible' do
          login_as(author)
    
          visit budget_investments_path(budget, heading_id: heading.id)
    
    
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 1 other location - About 25 mins to fix
    spec/features/budgets/investments_spec.rb on lines 835..843

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 31.

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

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

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

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

    Refactorings

    Further Reading

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

        within "#budget_investment_#{investment.id}" do
          find("#flag-expand-investment-#{investment.id}").click
          find("#flag-investment-#{investment.id}").click
    
          expect(page).to have_css("#unflag-expand-investment-#{investment.id}")
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 3 other locations - About 20 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1744..1748
    spec/features/budgets/investments_spec.rb on lines 1764..1768
    spec/features/budgets/investments_spec.rb on lines 1792..1796

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

    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

        within "#budget_investment_#{investment.id}" do
          find("#unflag-expand-investment-#{investment.id}").click
          find("#unflag-investment-#{investment.id}").click
    
          expect(page).to have_css("#flag-expand-investment-#{investment.id}")
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 3 other locations - About 20 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1744..1748
    spec/features/budgets/investments_spec.rb on lines 1764..1768
    spec/features/budgets/investments_spec.rb on lines 1783..1787

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

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

              within "#js-advanced-search" do
                expect(page).to have_selector("input[name='search'][value='Schwifty']")
                expect(page).to have_select('advanced_search[official_level]', selected: Setting['official_level_1_name'])
                expect(page).to have_select('advanced_search[date_min]', selected: 'Last 24 hours')
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 2 other locations - About 20 mins to fix
    spec/features/debates_spec.rb on lines 877..880
    spec/features/proposals_spec.rb on lines 1329..1332

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

    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

        within "#budget_investment_#{investment.id}" do
          find("#flag-expand-investment-#{investment.id}").click
          find("#flag-investment-#{investment.id}").click
    
          expect(page).to have_css("#unflag-expand-investment-#{investment.id}")
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 3 other locations - About 20 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1764..1768
    spec/features/budgets/investments_spec.rb on lines 1783..1787
    spec/features/budgets/investments_spec.rb on lines 1792..1796

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

    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

        within "#budget_investment_#{investment.id}" do
          find("#unflag-expand-investment-#{investment.id}").click
          find("#unflag-investment-#{investment.id}").click
    
          expect(page).to have_css("#flag-expand-investment-#{investment.id}")
    Severity: Minor
    Found in spec/features/budgets/investments_spec.rb and 3 other locations - About 20 mins to fix
    spec/features/budgets/investments_spec.rb on lines 1744..1748
    spec/features/budgets/investments_spec.rb on lines 1783..1787
    spec/features/budgets/investments_spec.rb on lines 1792..1796

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

    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

    Trailing whitespace detected. (https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace)
    Open

      

    Trailing whitespace detected. (https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace)
    Open

      

    Trailing whitespace detected. (https://github.com/bbatsov/ruby-style-guide#no-trailing-whitespace)
    Open

            

    Line is too long. [133/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

              bdgt_invest1 = create(:budget_investment, heading: heading,title: "Get Schwifty",   author: ana,  created_at: 1.minute.ago)

    Line is too long. [136/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

            expect(page).to have_css("a[href='#{budget_investment_path(budget_id: budget.id, id: investment.id)}']", text: investment.title)

    Line is too long. [131/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

              bdgt_invest2 = create(:budget_investment, heading: heading,title: "Hello Schwifty", author: john, created_at: 2.days.ago)

    Line is too long. [120/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          mid_investment = create(:budget_investment, :selected, heading: heading, title: 'Build a nice house', price: 1000)

    Don't repeat descriptions within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription)
    Open

      scenario "Show (winner budget investment)" do

    Line is too long. [118/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

        scenario 'Each user has a different and consistent random budget investment order when random_seed is disctint' do

    Line is too long. [106/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          (Kaminari.config.default_per_page * 1.3).to_i.times { create(:budget_investment, heading: heading) }

    Line is too long. [102/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                            unfeasibility_explanation: 'Local government is not competent in this matter')

    Line is too long. [102/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                                             description_es: "Último hito con el link https://consul.dev",

    Use let instead of an instance variable. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceVariable)
    Open

            expect(investments_order).to eq(@second_user_investments_order)

    Use let instead of an instance variable. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceVariable)
    Open

          expect(@first_user_investments_order).to eq(@second_user_investments_order)

    Prefer not_to over to_not. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/NotToNot)
    Open

            expect(page).to_not have_content(investment.description)

    Don't repeat descriptions within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription)
    Open

      scenario "Show (winner budget investment)" do

    Don't repeat examples within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample)
    Open

      scenario "Show (not selected budget investment)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,

    Line is too long. [129/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                expect(page).to have_selector("input[name='advanced_search[date_min]'][value*='#{7.days.ago.strftime('%d/%m/%Y')}']")

    Line is too long. [103/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

              expect(page).to have_content "You are seeing 5 of 6 investments containing the term 'search'"

    Line is too long. [114/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          investment1 = create(:budget_investment, :unselected, :feasible, heading: heading, valuation_finished: true)

    Don't repeat descriptions within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription)
    Open

      scenario "Show (not selected budget investment)" do

    Don't repeat descriptions within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription)
    Open

      scenario "Show (unfeasible budget investment with valuation not finished)" do

    Don't repeat examples within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample)
    Open

      scenario "Show (not selected budget investment)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,

    Line is too long. [103/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          visit budget_investments_path(budget_id: budget.id, heading_id: heading.id, filter: "unselected")

    Line is too long. [108/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

        scenario 'Each user has a equal and consistent budget investment order when the random_seed is equal' do

    Use let instead of an instance variable. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceVariable)
    Open

          expect(@first_user_investments_order).to eq(@second_user_investments_order)

    Don't repeat examples within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample)
    Open

      scenario "Show (winner budget investment)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,

    Line is too long. [110/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

        expect(page).to have_link "Go back", href: budget_investments_path(budget, heading_id: investment.heading)

    Line is too long. [126/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

        expect(page).to have_content("This investment project has been marked as not feasible and will not go to balloting phase")

    Line is too long. [102/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                            unfeasibility_explanation: 'Local government is not competent in this matter')

    Line is too long. [110/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          expect(first_milestone.description).to appear_before('Last milestone with a link to https://consul.dev')

    Line is too long. [121/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          low_investment = create(:budget_investment, :selected, heading: heading, title: 'Build an ugly house', price: 1000)

    Use let instead of an instance variable. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceVariable)
    Open

          expect(@first_user_investments_order).not_to eq(@second_user_investments_order)

    Don't repeat examples within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample)
    Open

      scenario "Show (selected budget investment)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,

    Line is too long. [114/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          investment3 = create(:budget_investment, :selected,   :feasible, heading: heading, valuation_finished: true)

    Line is too long. [103/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          visit budget_investments_path(budget_id: budget.id, heading_id: heading.id, filter: "unselected")

    %w-literals should be delimited by [ and ]. (https://github.com/bbatsov/ruby-style-guide#percent-literal-braces)
    Open

            %w(first second third fourth fifth sixth).each do |ordinal|

    This cop enforces the consistent usage of %-literal delimiters.

    Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

    Example:

    # Style/PercentLiteralDelimiters:
    #   PreferredDelimiters:
    #     default: '[]'
    #     '%i':    '()'
    
    # good
    %w[alpha beta] + %i(gamma delta)
    
    # bad
    %W(alpha #{beta})
    
    # bad
    %I(alpha beta)

    Use let instead of an instance variable. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceVariable)
    Open

            expect(investments_order).to eq(@first_user_investments_order)

    Don't repeat examples within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample)
    Open

      scenario "Show (winner budget investment)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,

    Don't repeat examples within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample)
    Open

      scenario "Show (unfeasible budget investment with valuation not finished)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,

    Don't repeat examples within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample)
    Open

      scenario "Show (unfeasible budget investment with valuation not finished)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,

    Line is too long. [128/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                expect(page).to have_selector("input[name='advanced_search[date_max]'][value*='#{1.day.ago.strftime('%d/%m/%Y')}']")

    Line is too long. [102/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                            unfeasibility_explanation: 'Local government is not competent in this matter')

    Line is too long. [102/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                            unfeasibility_explanation: 'Local government is not competent in this matter')

    Line is too long. [102/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                            unfeasibility_explanation: 'Local government is not competent in this matter')

    Line is too long. [114/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          investment4 = create(:budget_investment, :selected,   :feasible, heading: heading, valuation_finished: true)

    Line is too long. [101/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

        expect(page).to have_content("This investment project has not been selected for balloting phase")

    Don't repeat descriptions within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription)
    Open

      scenario "Show (not selected budget investment)" do

    Don't repeat descriptions within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription)
    Open

      scenario "Show (unfeasible budget investment with valuation not finished)" do

    %w-literals should be delimited by [ and ]. (https://github.com/bbatsov/ruby-style-guide#percent-literal-braces)
    Open

            %w(first second third fourth fifth sixth).each do |ordinal|

    This cop enforces the consistent usage of %-literal delimiters.

    Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

    Example:

    # Style/PercentLiteralDelimiters:
    #   PreferredDelimiters:
    #     default: '[]'
    #     '%i':    '()'
    
    # good
    %w[alpha beta] + %i(gamma delta)
    
    # bad
    %W(alpha #{beta})
    
    # bad
    %I(alpha beta)

    Don't repeat examples within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample)
    Open

      scenario "Show (unfeasible budget investment with valuation not finished)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,

    Line is too long. [102/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                            unfeasibility_explanation: 'Local government is not competent in this matter')

    Line is too long. [108/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                                             description_en: "Last milestone with a link to https://consul.dev",

    Line is too long. [119/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

      it_behaves_like "followable", "budget_investment", "budget_investment_path", { "budget_id": "budget_id", "id": "id" }

    Line is too long. [118/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

      it_behaves_like "imageable", "budget_investment", "budget_investment_path", { "budget_id": "budget_id", "id": "id" }

    Use let instead of an instance variable. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/InstanceVariable)
    Open

          expect(@first_user_investments_order).not_to eq(@second_user_investments_order)

    Don't repeat examples within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample)
    Open

      scenario "Show (not selected budget investment)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,

    Line is too long. [121/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

      it_behaves_like "documentable", "budget_investment", "budget_investment_path", { "budget_id": "budget_id", "id": "id" }

    Line is too long. [102/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                            unfeasibility_explanation: 'Local government is not competent in this matter')

    Line is too long. [103/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          visit budget_investments_path(budget_id: budget.id, heading_id: heading.id, filter: "unfeasible")

    Line is too long. [122/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          high_investment = create(:budget_investment, :selected, heading: heading, title: 'Build a skyscraper', price: 20000)

    Don't repeat descriptions within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription)
    Open

      scenario "Show (unfeasible budget investment with valuation not finished)" do

    Line is too long. [102/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                            unfeasibility_explanation: 'Local government is not competent in this matter')

    %w-literals should be delimited by [ and ]. (https://github.com/bbatsov/ruby-style-guide#percent-literal-braces)
    Open

            %w(first second third fourth fifth sixth).each do |ordinal|

    This cop enforces the consistent usage of %-literal delimiters.

    Specify the 'default' key to set all preferred delimiters at once. You can continue to specify individual preferred delimiters to override the default.

    Example:

    # Style/PercentLiteralDelimiters:
    #   PreferredDelimiters:
    #     default: '[]'
    #     '%i':    '()'
    
    # good
    %w[alpha beta] + %i(gamma delta)
    
    # bad
    %W(alpha #{beta})
    
    # bad
    %I(alpha beta)

    Don't repeat descriptions within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription)
    Open

      scenario "Show (selected budget investment)" do

    Don't repeat descriptions within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription)
    Open

      scenario "Show (unfeasible budget investment with valuation not finished)" do

    Don't repeat examples within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample)
    Open

      scenario "Show (selected budget investment)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,

    Line is too long. [101/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          fill_in 'budget_investment_description', with: 'I want to live in a high tower over the clouds'

    Line is too long. [103/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          expect(page).to have_content "You can change your vote at any time until the close of this phase"

    Line is too long. [114/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          investment2 = create(:budget_investment, :selected,   :feasible, heading: heading, valuation_finished: true)

    Don't repeat examples within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedExample)
    Open

      scenario "Show (unfeasible budget investment with valuation not finished)" do
        user = create(:user)
        login_as(user)
    
        investment = create(:budget_investment,

    Line is too long. [118/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

                expect(page).to have_select('advanced_search[official_level]', selected: Setting['official_level_1_name'])

    Line is too long. [106/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          (Kaminari.config.default_per_page * 1.3).to_i.times { create(:budget_investment, heading: heading) }

    Line is too long. [101/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

        expect(page).to have_content("This investment project has not been selected for balloting phase")

    Don't repeat descriptions within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription)
    Open

      scenario "Show (selected budget investment)" do

    Line is too long. [103/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

          investment1 = create(:budget_investment, :unfeasible, heading: heading, valuation_finished: true)

    Line is too long. [101/100] (https://github.com/bbatsov/ruby-style-guide#80-character-limits)
    Open

        expect(page).to have_content("This investment project has not been selected for balloting phase")

    Don't repeat descriptions within an example group. (http://www.rubydoc.info/gems/rubocop-rspec/RuboCop/Cop/RSpec/RepeatedDescription)
    Open

      scenario "Show (not selected budget investment)" do

    There are no issues that match your filters.

    Category
    Status