AyuntamientoMadrid/participacion

View on GitHub

Showing 2,535 of 2,535 total issues

File action_spec.rb has 272 lines of code (exceeds 250 allowed). Consider refactoring.
Open

require "rails_helper"

describe Dashboard::Action do
  subject do
    build(:dashboard_action,
Severity: Minor
Found in spec/models/dashboard/action_spec.rb - About 2 hrs to fix

    File stats_spec.rb has 271 lines of code (exceeds 250 allowed). Consider refactoring.
    Open

    require "rails_helper"
    
    describe "Stats", :admin do
      context "Summary" do
        scenario "General" do
    Severity: Minor
    Found in spec/system/admin/stats_spec.rb - About 2 hrs to fix

      Class Debate has 23 methods (exceeds 20 allowed). Consider refactoring.
      Open

      class Debate < ApplicationRecord
        include Flaggable
        include Taggable
        include Conflictable
        include Measurable
      Severity: Minor
      Found in app/models/debate.rb - About 2 hrs to fix

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

            scenario "Shows moderation activity from proposals moderation screen" do
              proposal1 = create(:proposal)
              proposal2 = create(:proposal)
              proposal3 = create(:proposal)
        
        
        Severity: Major
        Found in spec/system/admin/activity_spec.rb and 1 other location - About 2 hrs to fix
        spec/system/admin/activity_spec.rb on lines 286..311

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

        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 "Shows moderation activity from debates moderation screen" do
              debate1 = create(:debate)
              debate2 = create(:debate)
              debate3 = create(:debate)
        
        
        Severity: Major
        Found in spec/system/admin/activity_spec.rb and 1 other location - About 2 hrs to fix
        spec/system/admin/activity_spec.rb on lines 258..283

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

        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 heading_spec.rb has 267 lines of code (exceeds 250 allowed). Consider refactoring.
        Open

        require "rails_helper"
        
        describe Budget::Heading do
          let(:budget) { create(:budget) }
          let(:group) { create(:budget_group, budget: budget) }
        Severity: Minor
        Found in spec/models/budget/heading_spec.rb - About 2 hrs to fix

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

              it "checks allegations phase" do
                # future
                process.update!(allegations_start_date: Date.current + 2.days,
                                allegations_end_date: Date.current + 3.days)
                expect(process.allegations_phase.open?).to be false
          Severity: Major
          Found in spec/models/legislation/process/phase_spec.rb and 1 other location - About 2 hrs to fix
          spec/models/legislation/process/phase_spec.rb on lines 100..119

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

          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

            context "Tag cloud" do
              scenario "Display user tags" do
                create(:debate, tag_list: "Medio Ambiente")
                create(:debate, tag_list: "Economía")
          
          
          Severity: Major
          Found in spec/system/tags/debates_spec.rb and 1 other location - About 2 hrs to fix
          spec/system/tags/proposals_spec.rb on lines 219..246

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

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

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

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

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

          Refactorings

          Further Reading

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

              it "checks allegations phase" do
                # future
                process.update!(allegations_start_date: Date.current + 2.days,
                                allegations_end_date: Date.current + 3.days)
                expect(process.allegations_phase.started?).to be false
          Severity: Major
          Found in spec/models/legislation/process/phase_spec.rb and 1 other location - About 2 hrs to fix
          spec/models/legislation/process/phase_spec.rb on lines 32..51

          Duplicated Code

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

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

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

          Tuning

          This issue has a mass of 89.

          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

            context "Tag cloud" do
              scenario "Display user tags" do
                create(:proposal, tag_list: "Medio Ambiente")
                create(:proposal, tag_list: "Economía")
          
          
          Severity: Major
          Found in spec/system/tags/proposals_spec.rb and 1 other location - About 2 hrs to fix
          spec/system/tags/debates_spec.rb on lines 183..210

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

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

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

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

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

          Refactorings

          Further Reading

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

              it "checks debate phase" do
                # future
                process.update!(debate_start_date: Date.current + 2.days,
                                debate_end_date: Date.current + 3.days)
                expect(process.debate_phase.started?).to be false
          Severity: Major
          Found in spec/models/legislation/process/phase_spec.rb and 1 other location - About 2 hrs to fix
          spec/models/legislation/process/phase_spec.rb on lines 76..95

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

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

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

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

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

          Refactorings

          Further Reading

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

              it "checks debate phase" do
                # future
                process.update!(debate_start_date: Date.current + 2.days,
                                debate_end_date: Date.current + 3.days)
                expect(process.debate_phase.open?).to be false
          Severity: Major
          Found in spec/models/legislation/process/phase_spec.rb and 1 other location - About 2 hrs to fix
          spec/models/legislation/process/phase_spec.rb on lines 144..163

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

          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

                  add: function(e, data) {
                    var upload_data;
                    upload_data = App.Imageable.buildData(data, e.target);
                    App.Imageable.clearProgressBar(upload_data);
                    App.Imageable.setProgressBar(upload_data, "uploading");
          Severity: Major
          Found in app/assets/javascripts/imageable.js and 1 other location - About 2 hrs to fix
          app/assets/javascripts/documentable.js on lines 30..36

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

                  add: function(e, data) {
                    var upload_data;
                    upload_data = App.Documentable.buildData(data, e.target);
                    App.Documentable.clearProgressBar(upload_data);
                    App.Documentable.setProgressBar(upload_data, "uploading");
          Severity: Major
          Found in app/assets/javascripts/documentable.js and 1 other location - About 2 hrs to fix
          app/assets/javascripts/imageable.js on lines 28..34

          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

          Class Comment has 22 methods (exceeds 20 allowed). Consider refactoring.
          Open

          class Comment < ApplicationRecord
            include Flaggable
            include HasPublicAuthor
            include Graphqlable
            include Notifiable
          Severity: Minor
          Found in app/models/comment.rb - About 2 hrs to fix

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

                within "div#available-resources-section" do
                  expect(page).to have_content("Polls")
                  expect(page).to have_content("E-mail")
                  expect(page).to have_content("Poster")
                  expect(page).to have_content(available.title)
            Severity: Major
            Found in spec/system/dashboard/dashboard_spec.rb and 1 other location - About 2 hrs to fix
            spec/system/dashboard/dashboard_spec.rb on lines 218..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 87.

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

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

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

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

            Refactorings

            Further Reading

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

                within "div#available-resources-section" do
                  expect(page).to have_content("Polls")
                  expect(page).to have_content("E-mail")
                  expect(page).to have_content("Poster")
                  expect(page).to have_content(available.title)
            Severity: Major
            Found in spec/system/dashboard/dashboard_spec.rb and 1 other location - About 2 hrs to fix
            spec/system/dashboard/dashboard_spec.rb on lines 171..193

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

            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

                    } else {
                      $(answer).addClass("medium-6");
                      $(answer).removeClass("answer-divider");
                      if (!$(answer).hasClass("first")) {
                        $(answer).insertAfter($(answer).next("div.answer"));
            Severity: Major
            Found in app/assets/javascripts/polls.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/polls.js on lines 9..15

            Duplicated Code

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

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

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

            Tuning

            This issue has a mass of 81.

            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

                    if ($(answer).hasClass("medium-6")) {
                      $(answer).removeClass("medium-6");
                      $(answer).addClass("answer-divider");
                      if (!$(answer).hasClass("first")) {
                        $(answer).insertBefore($(answer).prev("div.answer"));
            Severity: Major
            Found in app/assets/javascripts/polls.js and 1 other location - About 2 hrs to fix
            app/assets/javascripts/polls.js on lines 15..21

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

            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 "Try to destroy with associated recount" do
                assignment = create(:poll_booth_assignment)
                officer_assignment = create(:poll_officer_assignment, booth_assignment: assignment)
                create(:poll_recount, booth_assignment: assignment, officer_assignment: officer_assignment)
            
            
            Severity: Major
            Found in spec/system/admin/poll/shifts_spec.rb and 1 other location - About 2 hrs to fix
            spec/system/admin/poll/shifts_spec.rb on lines 226..252

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

            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