Showing 8 of 13 total issues
Method redundancies
has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring. Open
def redundancies(opts = {})
minimum = opts[:minimum]
ignored_properties = opts[:ignored_properties] || []
ignored_selectors = opts[:ignored_selectors] || []
match_shorthand = opts.fetch(:match_shorthand, true)
- 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 execute
has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring. Open
def execute
deprecate("Use --show-parser-errors instead of CSSCSS_DEBUG") if ENV["CSSCSS_DEBUG"]
all_contents= @argv.map do |filename|
if filename =~ URI.regexp
- 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 redundancies
has 93 lines of code (exceeds 25 allowed). Consider refactoring. Open
def redundancies(opts = {})
minimum = opts[:minimum]
ignored_properties = opts[:ignored_properties] || []
ignored_selectors = opts[:ignored_selectors] || []
match_shorthand = opts.fetch(:match_shorthand, true)
Method parse
has 54 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse(argv)
options = OptionParser.new do |opts|
opts.banner = "Usage: csscss [files..]"
opts.version = Csscss::VERSION
Method execute
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
def execute
deprecate("Use --show-parser-errors instead of CSSCSS_DEBUG") if ENV["CSSCSS_DEBUG"]
all_contents= @argv.map do |filename|
if filename =~ URI.regexp
Method load_sass_file
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def load_sass_file(filename)
abort 'Must install the "sass" gem before parsing sass/scss files' unless gem_installed?("sass")
require "csscss/sass_include_extensions" if @ignore_sass_mixins
sass_options = {cache:false}
- 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 parse
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def parse(argv)
options = OptionParser.new do |opts|
opts.banner = "Usage: csscss [files..]"
opts.version = Csscss::VERSION
- 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_side
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def transform_side(side, context)
width = context[:width]
style = context[:style]
color = context[:color]
- 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"