Showing 309 of 5,637 total issues
File application_helper.rb
has 270 lines of code (exceeds 250 allowed). Consider refactoring. Open
module ApplicationHelper # rubocop:disable Metrics/ModuleLength
# this is used just to not load font awesome in tests
def capybara_webkit?
Rails.env.test? && defined?(Capybara.current_driver) && Capybara.current_driver == :webkit
Method friendly_service_setting
has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring. Open
def friendly_service_setting service, setting
value = service.send setting
message, value = case setting
when :custom_keys_enabled
['Custom application keys are VALUE', value ? 'enabled' : 'disabled']
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File rolling_updates.rb
has 266 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Logic
module RollingUpdates
class UnknownFeatureError < StandardError; end
class UnknownFeatureConfigError < StandardError
include Bugsnag::MetaData
File simple_layout.rb
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'sprockets'
require 'compass-rails'
require 'sass'
class SimpleLayout
File account.rb
has 265 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Liquid
module Drops
class Account < Drops::Model
info %{
Class Template
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class CMS::Template < ApplicationRecord
include Symbolize
include ThreeScale::Search::Scopes
include CMS::Filtering
Class FrontendController
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class FrontendController < ApplicationController
SecureHeaders::Configuration.override(:disable_x_frame) do |config|
config.x_frame_options = SecureHeaders::OPT_OUT
end
Class ClusterClient
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class ClusterClient
class ClusterClientError < StandardError; end
class ResourceNotFound < ClusterClientError
def initialize(resource_type, name, namespace, labels = {})
Class Contract
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Contract < ApplicationRecord
# Need to define table_name before audited because of
# https://github.com/collectiveidea/audited/blob/f03c5b5d1717f2ebec64032d269316dc74476056/lib/audited/auditor.rb#L305-L311
self.table_name = 'cinstances'
Class ClientBase
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class ClientBase
class ClientError < StandardError
include Bugsnag::MetaData
def initialize(error_message, options = {})
Method assert_line_items
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def assert_line_items(items)
items.hashes.each_with_index do |line, i|
name = line['name']
cost = line['cost']
cost = /#{cost}\./ unless cost.include?('.')
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
File email_template.rb
has 257 lines of code (exceeds 250 allowed). Consider refactoring. Open
class CMS::EmailTemplate < CMS::Template
validates :system_name, presence: true
validates :current, presence: true
validates :system_name, uniqueness: { scope: %i[provider_id], allow_blank: true, case_sensitive: true }
Class Section
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class CMS::Section < ApplicationRecord
include ThreeScale::Search::Scopes
include CMS::Filtering
extend System::Database::Scopes::IdOrSystemName
include NormalizePathAttribute
Class ApplicationKey
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class ApplicationKey < ApplicationRecord
include SaveDestroyForApplicationAssociation
KEYS_LIMIT = 5
Class Event
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Event
class Error < ::StandardError; end
class MissingResourceError < Error; end
# This object represents one webhook event
Class SimpleLayout
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class SimpleLayout
attr_reader :provider
def initialize(provider)
Class ApplicationsController
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class DeveloperPortal::Admin::ApplicationsController < ::DeveloperPortal::BaseController
self.responder = ThreeScale::Api::Responder
include Liquid::TemplateSupport
Class Service
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class Service < Drops::Model
allowed_name :service
def initialize(service, opts = {})
Method verify!
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def verify!(object)
# this controller shouldnt be checked
return true if @env["action_controller.request.path_parameters"]["controller"] == "provider/domains"
- Read upRead up
Cognitive Complexity
Cognitive Complexity is a measure of how difficult a unit of code is to intuitively understand. Unlike Cyclomatic Complexity, which determines how difficult your code will be to test, Cognitive Complexity tells you how difficult your code will be to read and comprehend.
A method's cognitive complexity is based on a few simple rules:
- Code is not considered more complex when it uses shorthand that the language provides for collapsing multiple statements into one
- Code is considered more complex for each "break in the linear flow of the code"
- Code is considered more complex when "flow breaking structures are nested"
Further reading
Method up
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.up
create_table :contracts do |t|
t.column :id, :int, :null => false, :autoincrement => true
#the provider