Showing 132 of 167 total issues
Method run!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def run!
begin
return perform!
rescue Exception => e
raise e if e.is_a? SystemExit
- 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 compile_if_required
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def compile_if_required(sass_filename, css_filename, sourcemap_filename = nil)
if should_compile?(sass_filename, css_filename, sourcemap_filename)
compile sass_filename, css_filename, sourcemap_filename
else
logger.record :unchanged, basename(sass_filename) unless options[:quiet]
- 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 included
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def self.included(base)
base.send(:include, StylesheetUrl) unless has?(base, :stylesheet_url)
base.send(:include, FontUrl) unless has?(base, :font_url)
base.send(:include, ImageUrl) unless has?(base, :image_url)
base.send(:include, GeneratedImageUrl) unless has?(base, :generated_image_url)
- 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 stylesheet_path
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def stylesheet_path(ss)
possible_names = possible_filenames_for_stylesheet(ss)
import_paths.each do |import_path|
possible_names.each do |filename|
full_path = File.join(import_path.first, filename)
- 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 selectors
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def selectors(item)
sass_tree = tree(item)
# Visitors::CheckNesting.visit(sass_tree)
# sass_tree = Visitors::Perform.visit(sass_tree)
selectors = []
- 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 add_support
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_support(function, *aspects)
aspects.each do |aspect|
unless ASPECTS.include?(aspect)
Compass::Util.compass_warn "Unknown support aspect: #{aspect}"
next
- 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 all_constants
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def all_constants
@items.inject([]) do |variables, item|
next variables unless item.identifier =~ %r{/reference}
next variables unless item[:stylesheet]
variables += constants(item).map{|v| [item, v] }
- 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 all_mixins
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def all_mixins
@items.inject([]) do |all_mixins, item|
next all_mixins unless item.identifier =~ %r{/reference}
next all_mixins unless item[:stylesheet]
all_mixins += mixins(item).map{|m| [item, m] }
- 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 color_stops_in_percentages
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def color_stops_in_percentages(color_list)
assert_type color_list, :List
color_list = normalize_stops(color_list)
max = color_list.value.last.stop
last_value = nil
- 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 all_functions
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def all_functions
@items.inject([]) do |all_functions, item|
next all_functions unless item.identifier =~ %r{/reference}
next all_functions unless item[:stylesheet]
all_functions += functions(item).map{|f| [item, f] }
- 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 add_import_path
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def add_import_path(*paths)
paths.map!{|p| defined?(Pathname) && Pathname === p ? p.to_s : p}
# The @added_import_paths variable works around an issue where
# the additional_import_paths gets overwritten during parse
@added_import_paths ||= []
- 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 to_sass_engine_options
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def to_sass_engine_options
engine_opts = {:load_paths => sass_load_paths}
engine_opts[:style] = output_style if output_style
engine_opts[:line_comments] = line_comments
if sass_3_4?
- 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 asset_cache_buster
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def asset_cache_buster(simple = nil, &block)
@set_attributes ||= {}
if block_given?
@set_attributes[:asset_cache_buster] = true
@asset_cache_buster = block
- 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 browser_ranges
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def browser_ranges(capability, prefix = nil, include_unprefixed_versions = true)
assert_valid_capability capability
browsers = prefix.nil? ? browsers() : browsers_with_prefix(prefix)
browsers.inject({}) do |m, browser|
browser_versions = versions(browser)
- 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 color_stops
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def color_stops(*args)
opts(list(args.map do |arg|
if ColorStop === arg
arg
elsif Sass::Script::Value::Color === arg
- 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
Consider simplifying this complex logical expression. Open
unless Sass::Script::Value::Color === color ||
Sass::Script::Tree::Funcall === color ||
(Sass::Script::Value::String === color && color.value == "currentColor")||
(Sass::Script::Value::String === color && color.value == "transparent")
raise Sass::SyntaxError, "Expected a color. Got: #{color}"
Method sprite_position
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def sprite_position(map, sprite = nil, offset_x = ZERO, offset_y = ZERO, use_percentages = BOOL_FALSE)
Method initialize
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(sprites, path, name, context, kwargs)
Method linear_svg
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def linear_svg(color_stops, x1, y1, x2, y2)
Method sprite
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def sprite(map, sprite, offset_x = ZERO, offset_y = ZERO, use_percentages = BOOL_FALSE)