Compass/compass

View on GitHub

Showing 134 of 168 total issues

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)
Severity: Minor
Found in cli/lib/compass/sass_extensions/functions/sprites.rb - About 35 mins to fix

    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)
    Severity: Minor
    Found in cli/lib/compass/sass_extensions/functions/sprites.rb - About 35 mins to fix

      Method initialize has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

              def initialize(sprites, path, name, context, kwargs)
      Severity: Minor
      Found in cli/lib/compass/sass_extensions/sprites/sprite_map.rb - About 35 mins to fix

        Method linear_svg has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

            def linear_svg(color_stops, x1, y1, x2, y2)
        Severity: Minor
        Found in core/lib/compass/core/sass_extensions/functions/gradient_support.rb - About 35 mins to fix

          Method perform has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def perform
                  super
                  require 'compass/stats'
                  compiler = new_compiler_instance
                  sass_files = sorted_sass_files(compiler)
          Severity: Minor
          Found in cli/lib/compass/commands/project_stats.rb - About 35 mins to fix

          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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def run
                failure_count = 0
                if new_config?
                  # Wipe out the cache and force compilation if the configuration has changed.
                  remove options[:cache_location] if options[:cache_location]
          Severity: Minor
          Found in cli/lib/compass/compiler.rb - About 35 mins to fix

          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_color_stop has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def parse_color_stop(arg)
                return ColorStop.new(arg) if arg.is_a?(Sass::Script::Value::Color)
                return nil unless arg.is_a?(Sass::Script::Value::String)
                color = stop = nil
                expr = Sass::Script::Parser.parse(arg.value, 0, 0)
          Severity: Minor
          Found in core/lib/compass/core/sass_extensions/functions/gradient_support.rb - About 35 mins to fix

          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 tile_images_that_repeat! has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                    def tile_images_that_repeat!
                      return unless repeating_images?
                      @images.map {|img| img if img.repeat_y?}.compact.each do |image|
                        y = (image.top + image.height)
                        while y < @height do
          Severity: Minor
          Found in cli/lib/compass/sass_extensions/sprites/layout/horizontal.rb - About 35 mins to fix

          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 css_columns has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def css_columns(css_file)
                  if File.exists?(css_file)
                    cf = Compass::Stats::CssFile.new(css_file)
                    cf.analyze!
                    %w(selector_count prop_count file_size).map do |t|
          Severity: Minor
          Found in cli/lib/compass/commands/project_stats.rb - About 35 mins to fix

          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 directory has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

              def directory(dir, options = nil)
                options ||= self.options if self.respond_to?(:options)
                options ||= {}
                if File.exists?(dir) && File.directory?(dir)
                    # do nothing
          Severity: Minor
          Found in cli/lib/compass/actions.rb - About 35 mins to fix

          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 run has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def run(run_options = {})
                  prepare unless run_options[:skip_preparation]
                  install unless options[:prepare]
                  finalize(options.merge(run_options)) unless options[:prepare] || run_options[:skip_finalization]
                end
          Severity: Minor
          Found in cli/lib/compass/installers/base.rb - About 35 mins to fix

          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 tile_images_that_repeat! has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                    def tile_images_that_repeat!
                      return unless repeating_images?
                      @images.map {|img| img if img.repeat_x?}.compact.each do |image|
                        x = image.left - (image.left / image.width).ceil * image.width
                        while x < @width do
          Severity: Minor
          Found in cli/lib/compass/sass_extensions/sprites/layout/vertical.rb - About 35 mins to fix

          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 search_index has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

          def search_index
            id = 0;
            idx = {
              "approximate" => {},
              "terms" => {},
          Severity: Minor
          Found in compass-style.org/lib/search.rb - About 35 mins to fix

          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_links has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def stylesheet_links
                  html = "<head>\n"
                  manifest.each_stylesheet do |stylesheet|
                    # Skip partials.
                    next if File.basename(stylesheet.from)[0..0] == "_"
          Severity: Minor
          Found in cli/lib/compass/installers/manifest_installer.rb - About 35 mins to fix

          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 initialize has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def initialize(name, *arguments)
                  options = arguments.last.is_a?(Hash) ? arguments.pop : {}
                  self.path = path = options[:path] || arguments.shift
                  @name = name
                  @templates_directory = options[:templates_directory]
          Severity: Minor
          Found in core/lib/compass/frameworks.rb - About 35 mins to fix

          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 http_join has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
          Open

                def http_join(*segments)
                  segments.map do |segment|
                    next unless segment
                    segment = http_pathify(segment)
                    segment[-1..-1] == "/" ? segment[0..-2] : segment
          Severity: Minor
          Found in core/lib/compass/configuration/defaults.rb - About 35 mins to fix

          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_arguments! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

                  def parse_arguments!(parser, arguments)
                    if arguments.size > 0
                      parser.options[:project_name] = arguments.shift if File.directory?(arguments.first)
                      unless arguments.empty?
                        parser.options[:sass_files] = arguments.dup
          Severity: Minor
          Found in cli/lib/compass/commands/clean_project.rb - About 25 mins to fix

          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 arg_to_sass has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

                def arg_to_sass(arg, format = :text)
                  name, default_value = arg
                  sass_str = ""
                  if format == :html
                    ddv = %Q{ data-default-value="#{h(default_value.to_sass)}"} if default_value
          Severity: Minor
          Found in compass-style.org/lib/stylesheets/sass_extensions.rb - About 25 mins to fix

          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 assert_legal_color! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

              def assert_legal_color!(color)
                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")
          Severity: Minor
          Found in core/lib/compass/core/sass_extensions/functions/gradient_support.rb - About 25 mins to fix

          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_arguments! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
          Open

                  def parse_arguments!(parser, arguments)
                    if arguments.size > 0
                      parser.options[:project_name] = arguments.shift if File.directory?(arguments.first)
                      unless arguments.empty?
                        parser.options[:only_sass_files] = absolutize(*arguments)
          Severity: Minor
          Found in cli/lib/compass/commands/update_project.rb - About 25 mins to fix

          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

          Severity
          Category
          Status
          Source
          Language