Showing 32 of 42 total issues
Method push
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def push
require 'haml'
Locomotive::Wagon.require_misc_gems
- 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 init
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def init(name, path = '.', *generator_options)
force_color_if_asked(options)
require 'locomotive/wagon/generators/site'
require File.expand_path(options[:lib]) if options[:lib]
generator = Locomotive::Wagon::Generators::Site.get(:blank)
- 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 each_resource
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def each_resource
RESOURCES.each do |name|
next if !options[:resources].blank? && !options[:resources].include?(name)
next if RESOURCES_WITH_CONTENT.include?(name) && !options[:data]
- 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 yaml_attributes
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def yaml_attributes(content_type, entry)
fields = %w(_slug) + content_type.fields.map { |f| f['name'] } + %w(seo_title meta_description meta_keywords)
localized_fields = (content_type.attributes['localized_names'] || []) + %w(_slug seo_title meta_description meta_keywords)
attributes = {}
- 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 _push
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def _push(api_client)
validate!
content_assets_pusher = Locomotive::Wagon::PushContentAssetsCommand.new(api_client, steam_services)
- 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 write_to_file
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def write_to_file(filepath, content = nil, mode = 'w+', &block)
_filepath = File.join(path, filepath)
folder = File.dirname(_filepath)
- 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 value_of
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def value_of(content_type, entry, locale, name)
# attribute not translated
return nil if entry[locale].nil?
if value = entry[locale].attributes[name]
- 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 extra_blocks
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def extra_blocks
# build block settings
_settings = settings.map do |raw_setting|
next unless raw_setting.starts_with?('block:') # block setting
_, block_type, id, type = raw_setting.split(':')
- 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 subscribe_to_notifications
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def subscribe_to_notifications
# Page not found
ActiveSupport::Notifications.subscribe('steam.render.page_not_found') do |name, start, finish, id, payload|
fullpath, locale, default_locale = payload[:path], payload[:locale], payload[:default_locale]
- 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 transform
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.transform(hash, &block)
return if hash.blank? || !hash.respond_to?(:has_key?)
hash.each do |key, value|
case value
- 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 deploy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def deploy(env, path = '.')
force_color_if_asked(options)
if check_path!(path)
begin
- 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 find_unique_filepath
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def find_unique_filepath(filepath, binary_file, index = 1)
if File.exist?(filepath) && File.file?(filepath)
# required because we need to make sure we use the content of file from its start
binary_file.rewind
- 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"