Showing 1,909 of 1,909 total issues
File budget_investments_spec.rb
has 1426 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rails_helper"
describe "Admin budget investments", :admin do
let(:budget) { create(:budget) }
let(:administrator) do
File investments_spec.rb
has 1337 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rails_helper"
require "sessions_helper"
describe "Budget Investments" do
let(:author) { create(:user, :level_two, username: "Isabel") }
File proposals_spec.rb
has 1263 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rails_helper"
describe "Proposals" do
it_behaves_like "milestoneable", :proposal
File investment_spec.rb
has 1045 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rails_helper"
describe Budget::Investment do
let(:investment) { build(:budget_investment) }
Similar blocks of code found in 2 locations. Consider refactoring. Open
describe "/moderation/ screen" do
before do
moderator = create(:moderator)
login_as(moderator.user)
end
- Read upRead up
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 540.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
describe "/moderation/ screen" do
before do
moderator = create(:moderator)
login_as(moderator.user)
end
- Read upRead up
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 540.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
describe "Debate index order filters" do
scenario "Default order is hot_score" do
best_debate = create(:debate, title: "Best")
best_debate.update_column(:hot_score, 10)
worst_debate = create(:debate, title: "Worst")
- Read upRead up
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 522.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
describe "Proposal index order filters" do
scenario "Default order is hot_score" do
best_proposal = create(:proposal, title: "Best proposal")
best_proposal.update_column(:hot_score, 10)
worst_proposal = create(:proposal, title: "Worst proposal")
- Read upRead up
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 522.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File topics_spec.rb
has 825 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rails_helper"
describe "Commenting topics from proposals" do
let(:user) { create :user }
let(:proposal) { create :proposal }
File proposal_spec.rb
has 814 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rails_helper"
describe Proposal do
let(:proposal) { build(:proposal) }
File user_spec.rb
has 661 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rails_helper"
describe User do
describe "#headings_voted_within_group" do
it "returns the headings voted by a user" do
Similar blocks of code found in 2 locations. Consider refactoring. Open
describe "#hot_score" do
let(:now) { Time.current }
it "period is correctly calculated to get exact votes per day" do
new_proposal = create(:proposal, created_at: 23.hours.ago)
- Read upRead up
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 353.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
Similar blocks of code found in 2 locations. Consider refactoring. Open
describe "#hot_score" do
let(:now) { Time.current }
it "period is correctly calculated to get exact votes per day" do
new_proposal = create(:legislation_proposal, created_at: 23.hours.ago)
- Read upRead up
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 353.
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
- Extract Method
- Extract Class
- Form Template Method
- Introduce Null Object
- Pull Up Method
- Pull Up Field
- Substitute Algorithm
Further Reading
- Don't Repeat Yourself on the C2 Wiki
- Duplicated Code on SourceMaking
- Refactoring: Improving the Design of Existing Code by Martin Fowler. Duplicated Code, p76
File debates_spec.rb
has 619 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rails_helper"
describe "Debates" do
context "Concerns" do
it_behaves_like "notifiable in-app", :debate
Class MenuComponent
has 70 methods (exceeds 20 allowed). Consider refactoring. Open
class Admin::MenuComponent < ApplicationComponent
include LinkListHelper
delegate :can?, to: :helpers
def links
File debate_spec.rb
has 585 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rails_helper"
describe Debate do
let(:debate) { build(:debate) }
File legislation_annotations_spec.rb
has 571 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rails_helper"
describe "Commenting legislation questions" do
let(:user) { create :user }
let(:legislation_annotation) { create :legislation_annotation, author: user }
File users_auth_spec.rb
has 536 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rails_helper"
describe "Users" do
context "Regular authentication" do
context "Sign up" do
File ballots_spec.rb
has 514 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "rails_helper"
require "sessions_helper"
describe "Ballots" do
let(:user) { create(:user, :level_two) }
ReDoS based DoS vulnerability in Active Support’s underscore Open
activesupport (6.0.6.1)
- Read upRead up
- Exclude checks
Advisory: CVE-2023-22796
URL: https://github.com/rails/rails/releases/tag/v7.0.4.1
Solution: upgrade to >= 5.2.8.15, ~> 5.2.8, >= 6.1.7.1, ~> 6.1.7, >= 7.0.4.1