Showing 143 of 1,085 total issues
File machine_learning.rb
has 412 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class MachineLearning
attr_reader :user, :script, :previous_modified_date
attr_accessor :job
SCRIPTS_FOLDER = Rails.root.join("public", "machine_learning", "scripts").freeze
File emails_spec.rb
has 410 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "rails_helper"
describe "Emails" do
before do
reset_mailer
File budget_investments_spec.rb
has 408 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "rails_helper"
describe "Valuation budget investments" do
let(:budget) { create(:budget, :valuating) }
let(:valuator) do
File translatable_spec.rb
has 384 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "rails_helper"
describe "Admin edit translatable records", :admin do
before do
translatable.main_link_url = "https://consuldemocracy.org" if translatable.is_a?(Budget::Phase)
Class Budget
has 39 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Budget < ApplicationRecord
include Measurable
include Sluggable
include Reportable
include Imageable
File budgets_spec.rb
has 370 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "rails_helper"
describe "Admin budgets", :admin do
it_behaves_like "nested imageable",
"budget",
Class Stats
has 37 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Budget::Stats
include Statisticable
alias_method :budget, :resource
def self.stats_methods
File relations_spec.rb
has 367 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "rails_helper"
describe "SDG Relations" do
before do
login_as(create(:administrator).user)
File tenant_spec.rb
has 362 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "rails_helper"
require "active_storage/service/disk_service"
describe Tenant do
describe ".resolve_host" do
Method defaults
has 113 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def defaults
{
"feature.featured_proposals": nil,
"feature.facebook_login": true,
"feature.google_login": true,
File users_spec.rb
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "rails_helper"
describe "Users" do
describe "Show (public page)" do
let(:user) { create(:user) }
Method initialize
has 110 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(user)
merge Abilities::Moderation.new(user)
merge Abilities::SDG::Manager.new(user)
can :restore, Comment
File draft_versions_spec.rb
has 350 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "rails_helper"
describe "Legislation Draft Versions" do
let(:user) { create(:user) }
let(:administrator) do
File budgets_spec.rb
has 349 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "rails_helper"
describe "Budgets" do
let(:budget) { create(:budget) }
let(:level_two_user) { create(:user, :level_two) }
Class Proposal
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Proposal < ApplicationRecord
include Flaggable
include Taggable
include Conflictable
include Measurable
Class Poll
has 33 methods (exceeds 20 allowed). Consider refactoring. Open
Open
class Poll < ApplicationRecord
include Imageable
acts_as_paranoid column: :hidden_at
include ActsAsParanoidAliases
include Notifiable
File processes_spec.rb
has 340 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "rails_helper"
describe "Legislation" do
let!(:administrator) { create(:administrator).user }
File investment.rb
has 336 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
class Budget
class Investment < ApplicationRecord
SORTING_OPTIONS = { id: "id", supports: "cached_votes_up" }.freeze
include Measurable
Method initialize
has 92 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def initialize(user)
merge Abilities::Everyone.new(user)
can [:read, :update], User, id: user.id
File stats_spec.rb
has 307 lines of code (exceeds 250 allowed). Consider refactoring. Open
Open
require "rails_helper"
describe "Stats", :admin do
context "Summary" do
scenario "General" do