Showing 4,066 of 4,066 total issues

File ballots_spec.rb has 486 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require 'rails_helper'

feature 'Ballots' do

  let!(:user)       { create(:user, :level_two) }
Severity: Minor
Found in spec/features/budgets/ballots_spec.rb - About 7 hrs to fix

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

    feature 'Admin' do
      let(:user) { create(:user) }
      let(:administrator) do
        create(:administrator, user: user)
        user
    Severity: Major
    Found in spec/features/admin_spec.rb and 1 other location - About 7 hrs to fix
    spec/custom/features/admin_spec.rb on lines 3..90

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 238.

    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

    feature 'Admin' do
      let(:user) { create(:user) }
      let(:administrator) do
        create(:administrator, user: user)
        user
    Severity: Major
    Found in spec/custom/features/admin_spec.rb and 1 other location - About 7 hrs to fix
    spec/features/admin_spec.rb on lines 3..90

    Duplicated Code

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

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

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

    Tuning

    This issue has a mass of 238.

    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

    Class User has 49 methods (exceeds 20 allowed). Consider refactoring.
    Open

    class User < ActiveRecord::Base
    
      include Verification
    
      devise :database_authenticatable, :registerable, :confirmable, :recoverable, :rememberable,
    Severity: Minor
    Found in app/models/user.rb - About 6 hrs to fix

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

      describe SignatureSheet do
      
        let(:signature_sheet) { build(:signature_sheet) }
      
        describe "validations" do
      Severity: Major
      Found in spec/models/signature_sheet_spec.rb and 1 other location - About 6 hrs to fix
      spec/custom/models/signature_sheet_spec.rb on lines 3..92

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

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

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

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

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

      Refactorings

      Further Reading

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

      describe SignatureSheet do
      
        let(:signature_sheet) { build(:signature_sheet) }
      
        describe "validations" do
      Severity: Major
      Found in spec/custom/models/signature_sheet_spec.rb and 1 other location - About 6 hrs to fix
      spec/models/signature_sheet_spec.rb on lines 3..92

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

      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

        feature 'Voting comments' do
      
          background do
            @manuela = create(:user, verified_at: Time.current)
            @pablo = create(:user)
      Severity: Major
      Found in spec/features/comments/proposals_spec.rb and 1 other location - About 6 hrs to fix
      spec/features/comments/polls_spec.rb on lines 435..522

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

      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

        feature 'Voting comments' do
      
          background do
            @manuela = create(:user, verified_at: Time.current)
            @pablo = create(:user)
      Severity: Major
      Found in spec/features/comments/polls_spec.rb and 1 other location - About 6 hrs to fix
      spec/features/comments/proposals_spec.rb on lines 414..501

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

      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

      Class Investment has 47 methods (exceeds 20 allowed). Consider refactoring.
      Open

        class Investment < ActiveRecord::Base
          SORTING_OPTIONS = %w(id title supports).freeze
      
          include Rails.application.routes.url_helpers
          include Measurable
      Severity: Minor
      Found in app/models/budget/investment.rb - About 6 hrs to fix

        File emails_spec.rb has 419 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require 'rails_helper'
        
        feature 'Emails' do
        
          background do
        Severity: Minor
        Found in spec/features/emails_spec.rb - About 6 hrs to fix

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

            describe "#generate_phases" do
              let(:drafting_phase)          { budget.phases.drafting }
              let(:informing_phase)         { budget.phases.informing }
              let(:accepting_phase)         { budget.phases.accepting }
              let(:reviewing_phase)         { budget.phases.reviewing }
          Severity: Major
          Found in spec/custom/models/budget_spec.rb and 1 other location - About 6 hrs to fix
          spec/models/budget_spec.rb on lines 205..240

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

          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

            describe "#generate_phases" do
              let(:drafting_phase)          { budget.phases.drafting }
              let(:informing_phase)         { budget.phases.informing }
              let(:accepting_phase)         { budget.phases.accepting }
              let(:reviewing_phase)         { budget.phases.reviewing }
          Severity: Major
          Found in spec/models/budget_spec.rb and 1 other location - About 6 hrs to fix
          spec/custom/models/budget_spec.rb on lines 193..228

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

          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

            feature "Administrators" do
              scenario "can create comment as an administrator", :js do
                admin = create(:administrator)
          
                login_as(admin.user)
          Severity: Major
          Found in spec/features/comments/legislation_annotations_spec.rb and 1 other location - About 5 hrs to fix
          spec/features/comments/legislation_annotations_spec.rb on lines 372..431

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

          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

            feature "Moderators" do
              scenario "can create comment as a moderator", :js do
                moderator = create(:moderator)
          
                login_as(moderator.user)
          Severity: Major
          Found in spec/features/comments/legislation_annotations_spec.rb and 1 other location - About 5 hrs to fix
          spec/features/comments/legislation_annotations_spec.rb on lines 435..494

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

          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

          File budget_investments_spec.rb has 409 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          require 'rails_helper'
          
          feature 'Valuation budget investments' do
          
            let(:budget) { create(:budget, :valuating) }
          Severity: Minor
          Found in spec/features/valuation/budget_investments_spec.rb - About 5 hrs to fix

            File legislation_questions_spec.rb has 406 lines of code (exceeds 250 allowed). Consider refactoring.
            Open

            require 'rails_helper'
            include ActionView::Helpers::DateHelper
            
            feature 'Commenting legislation questions' do
            
            
            Severity: Minor
            Found in spec/features/comments/legislation_questions_spec.rb - About 5 hrs to fix

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

                feature "Moderators" do
                  scenario "can create comment as a moderator", :js do
                    moderator = create(:moderator)
              
                    login_as(moderator.user)
              Severity: Major
              Found in spec/features/comments/legislation_questions_spec.rb and 3 other locations - About 5 hrs to fix
              spec/features/comments/budget_investments_spec.rb on lines 317..369
              spec/features/comments/budget_investments_spec.rb on lines 373..425
              spec/features/comments/legislation_questions_spec.rb on lines 402..454

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

              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

                feature "Administrators" do
                  scenario "can create comment as an administrator", :js do
                    admin = create(:administrator)
              
                    login_as(admin.user)
              Severity: Major
              Found in spec/features/comments/legislation_questions_spec.rb and 3 other locations - About 5 hrs to fix
              spec/features/comments/budget_investments_spec.rb on lines 317..369
              spec/features/comments/budget_investments_spec.rb on lines 373..425
              spec/features/comments/legislation_questions_spec.rb on lines 346..398

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

              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

                feature "Administrators" do
                  scenario "can create comment as an administrator", :js do
                    admin = create(:administrator)
              
                    login_as(admin.user)
              Severity: Major
              Found in spec/features/comments/budget_investments_spec.rb and 3 other locations - About 5 hrs to fix
              spec/features/comments/budget_investments_spec.rb on lines 317..369
              spec/features/comments/legislation_questions_spec.rb on lines 346..398
              spec/features/comments/legislation_questions_spec.rb on lines 402..454

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

              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

                feature "Administrators" do
                  scenario "can create comment as an administrator", :js do
                    skip "Feature not implemented yet, review soon"
              
                    admin = create(:administrator)
              Severity: Major
              Found in spec/features/comments/polls_spec.rb and 1 other location - About 5 hrs to fix
              spec/features/comments/polls_spec.rb on lines 310..369

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

              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