chriseppstein/compass

View on GitHub

Showing 132 of 167 total issues

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

  def self.make_asset_host_proc(v, ctx)
    proc do |file|
      if ctx.environment.function(v.value) || Sass::Script::Functions.callable?(v.value.tr('-', '_'))
        result = ctx.call(v, ctx.quoted_string(file))
        case result
Severity: Minor
Found in core/lib/compass/core/sass_extensions/functions/configuration.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 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 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 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 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 calculate_positions! has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def calculate_positions!
            @images.each_with_index do |image, index|
              image.top = image.position.unit_str == '%' ? (@height - image.height) * (image.position.value / 100.0) : image.position.value
              next if index == 0
              last_image = @images[index-1]
Severity: Minor
Found in cli/lib/compass/sass_extensions/sprites/layout/horizontal.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 when_updated_stylesheet has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def when_updated_stylesheet(sass_file, css, sourcemap)
    if css && display_compilation_times && @start_times[sass_file]
      duration = ((Time.now - @start_times[sass_file]) * 1000).round / 1000.0
      logger.record :write, "#{relativize(css)} (#{duration}s)"
    else
Severity: Minor
Found in cli/lib/compass/sass_compiler.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 reference_item has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

def reference_item(options)
  stylesheet = options[:stylesheet]
  path = stylesheet_path(stylesheet)
  if path
    @site.cached("reference/item/#{path}") do
Severity: Minor
Found in compass-style.org/lib/stylesheets.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 first_value_of has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  def first_value_of(list)
    if list.is_a?(Sass::Script::Value::String)
      r = list.value.split(/\s+/).first
      list.type == :identifier ? identifier(r) : quoted_string(r)
    elsif list.is_a?(Sass::Script::Value::List)
Severity: Minor
Found in core/lib/compass/core/sass_extensions/functions/lists.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 pad has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def pad(c, max, options = {})
        options[:align] ||= :left
        if c == :-
          filler = '-'
          c = ''
Severity: Minor
Found in cli/lib/compass/commands/project_stats.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 notify_watches has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def notify_watches(modified, added, removed)
        project_path = Compass.configuration.project_path
        files = {:modified => modified,
                 :added    => added,
                 :removed  => removed}
Severity: Minor
Found in cli/lib/compass/commands/watch_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 color has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def color(c)
      if Compass.configuration.color_output && c && COLORS.has_key?(c.to_sym)
        if defined?($boring) && $boring
          ""
        else
Severity: Minor
Found in cli/lib/compass/logger.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