Showing 591 of 591 total issues
Block has too many lines. [81/25] Open
ActiveAdmin.register Proposal do
actions :index, :show
permit_params :status
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Class User
has 35 methods (exceeds 20 allowed). Consider refactoring. Open
class User < ActiveRecord::Base
has_paper_trail class_name: "C2Version"
validates :client_slug, inclusion: {
in: ->(_) { Proposal.client_slugs },
Class WorkOrder
has 34 methods (exceeds 20 allowed). Consider refactoring. Open
class WorkOrder < ActiveRecord::Base
# must define before include PurchaseCardMixin
def self.purchase_amount_column_name
:amount
end
Block has too many lines. [71/25] Open
C2::Application.routes.draw do
use_doorkeeper do
controllers applications: "oauth/applications"
end
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Assignment Branch Condition size for base_fields is too high. [34/15] Open
def base_fields
[
[translated_key("project_title"), object.project_title],
[translated_key("description"), object.description],
[translated_key("approving_official"), object.approving_official],
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Class ProposalsController
has 31 methods (exceeds 20 allowed). Consider refactoring. Open
class ProposalsController < ApplicationController
include TokenAuth
skip_before_action :authenticate_user!, only: [:approve, :complete]
skip_before_action :check_disabled_client, only: [:approve, :complete]
Class Procurement
has 30 methods (exceeds 20 allowed). Consider refactoring. Open
class Procurement < ActiveRecord::Base
URGENCY = {
10 => "I need it yesterday",
20 => "I'm patient but would like w/in a week",
30 => "Whenever",
Block has too many lines. [65/25] Open
included do
include Elasticsearch::Model
after_commit on: [:create] do
if Rails.env.test?
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Class ApplicationController
has 26 methods (exceeds 20 allowed). Consider refactoring. Open
class ApplicationController < ActionController::Base
include Pundit
include ReturnToHelper
include MarkdownHelper
Block has too many lines. [56/25] Open
ActiveAdmin.register Step do
actions :index, :show, :update, :edit
filter :status
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Function ListConfig
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
function ListConfig() {
var config = [
{
targets: "th-value-id"
},
Block has too many lines. [55/25] Open
ActiveAdmin.register Delayed::Job, as: "Job" do
actions :index, :show, :edit, :update, :destroy
index do
column :id
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Block has too many lines. [55/25] Open
namespace :dev do
desc "Sample data for local development environment"
task :prime, [:email] => ["db:setup"] do |_task, args|
include FactoryGirl::Syntax::Methods
- Read upRead up
- Exclude checks
This cop checks if the length of a block exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable. The cop can be configured to ignore blocks passed to certain methods.
Assignment Branch Condition size for base_email_fields is too high. [24/15] Open
def base_email_fields
[
[amount_and_not_to_exceed, object.amount],
[translated_key("cl_number"), object.cl_number],
[translated_key("expense_type"), object.expense_type],
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Class ClientDataController
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class ClientDataController < ApplicationController
include TokenAuth
before_action -> { authorize model_class }, only: [:new, :create]
before_action -> { authorize proposal }, only: [:edit, :update]
before_action :build_client_data_instance, only: [:new, :create]
Class Event
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Event < ActiveRecord::Base
URGENCY = {
10 => "I need it yesterday",
20 => "I'm patient but would like w/in a week",
30 => "Whenever"
Class ProposalSearchDsl
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class ProposalSearchDsl
include Elasticsearch::DSL
attr_reader :params, :current_user, :query_str, :client_data_type
Class Dispatcher
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Dispatcher
def initialize(proposal)
@proposal = proposal
end
Class ProposalPolicy
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class ProposalPolicy
include ExceptionPolicy
def initialize(user, record)
super(user, record)
Class ProposalListingQuery
has 23 methods (exceeds 20 allowed). Consider refactoring. Open
class ProposalListingQuery
attr_reader :params, :relation, :user
def initialize(user, params, proposals = Proposal.all)
@params = params