Showing 132 of 167 total issues
Function Brush
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
function Brush()
{
function getKeywordsSCSS(str)
{
return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
Method compute_url
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def compute_url(type, relative_path, relative_to_css_url = nil, use_cache_buster = true)
# pass through fully specified urls
return relative_path if relative_path.start_with?("http://")
clean_relative_path, query, target = clean_path(relative_path)
- 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 with_each_font_file
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
def with_each_font_file(*args)
skip_next = false
args.each_with_index do |path, index|
assert_type path, :String
- 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 inherited_array
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
def inherited_array(*attributes)
options = attributes.last.is_a?(Hash) ? attributes.pop : {}
inherited_reader(*attributes)
inherited_writer(*attributes)
attributes.each do |attr|
Method set_project_options
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_project_options(opts)
opts.on('-c', '--config CONFIG_FILE', 'Specify the location of the configuration file explicitly.') do |configuration_file|
self.options[:configuration_file] = configuration_file
end
Method serialize
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def serialize
contents = ""
(required_libraries || []).each do |lib|
contents << %Q{require '#{lib}'\n}
end
- 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 grad_position
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def grad_position(color_list, index, default, radial = bool(false))
assert_type color_list, :List
stop = color_list.value[index.value - 1].stop
if stop && radial.to_bool
orig_stop = stop
- 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 visit_depth_first
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def visit_depth_first(visitor)
visitor.visit(self)
visitor.down(self) if children.any? and visitor.respond_to?(:down)
if is_a?(ImportNode) && visitor.import?(self)
root = Sass::Engine.for_file(import, @options).to_tree
- 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_sass_configuration
has 42 lines of code (exceeds 25 allowed). Consider refactoring. Open
def add_sass_configuration(project_path)
css_location = template_location = nil
if options[:template_location] && options[:template_location].is_a?(Array)
css_location = File.expand_path(options[:template_location].first.last)
template_location = File.expand_path(options[:template_location].first.first)
Method set_global_options
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
def set_global_options(opts)
opts.on('-r LIBRARY', '--require LIBRARY',
"Require the given ruby LIBRARY before running commands.",
" This is used to access compass plugins without having a",
" project configuration file."
Method md5sum
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def md5sum(file, format = nil)
assert_type file, :String
filename = nil
if options[:css_filename] && File.exists?(options[:css_filename])
filename = File.expand_path(file.value, File.dirname(options[:css_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 write_file
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def write_file(file_name, contents, options = nil, binary = false)
options ||= self.options if self.respond_to?(:options)
skip_write = false
contents = process_erb(contents, options[:erb]) if options[:erb]
if File.exists?(file_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 omitted_usage
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def omitted_usage(browser, min_version, max_version = nil)
versions = versions(browser)
min_version = caniuse_version(browser, min_version)
max_version = caniuse_version(browser, max_version)
if max_version.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 add_project_configuration
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def add_project_configuration(*args)
options = args.last.is_a?(Hash) ? args.pop : {}
configuration_file_path = args.shift || detect_configuration_file
raise ArgumentError, "Too many arguments" if args.any?
- 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 examine
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def examine(io)
class << io
unless method_defined?(:readbyte)
def readbyte
getc
- 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 discover
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def discover(type)
type = self.class.plural_types[type] || type
dir = File.dirname(@manifest_file)
Dir.glob("#{dir}/**/*").each do |file|
next if /manifest\.rb/ =~ file
- 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 perform
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
def perform
super
require 'compass/stats'
compiler = new_compiler_instance
sass_files = sorted_sass_files(compiler)
Method perform!
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def perform!
$command = args.shift
command_class = Compass::Commands[$command]
unless command_class
args.unshift($command)
- 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 compare_browser_versions
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def compare_browser_versions(browser, version1, version2)
assert_type browser, :String, :browser
assert_type version1, :String, :version1
assert_type version2, :String, :version2
index1 = index2 = 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 grad_point
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def grad_point(position)
original_value = position
position = unless position.is_a?(Sass::Script::Value::List)
opts(list([position], :space))
else
- 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"