Compass/compass

View on GitHub

Showing 168 of 168 total issues

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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            def to_s_prefixed(options = self.options)
              s = "linear-gradient("
              if legacy
                s << position_or_angle.to_s(options) << ", " if position_or_angle
              else
        core/lib/compass/core/sass_extensions/functions/gradient_support.rb on lines 411..419

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 35.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        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

        Similar blocks of code found in 2 locations. Consider refactoring.
        Open

            def to_s(options = self.options)
              s = 'linear-gradient('
              if legacy
                s << convert_to_or_from_legacy(position_or_angle, options) << ", " if position_or_angle
              else
        core/lib/compass/core/sass_extensions/functions/gradient_support.rb on lines 391..399

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 35.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        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

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

                if ($("#cssdir").val() != "")
                  create_command += " --css-dir \"" +  $("#cssdir").val() + "\"";
        Severity: Major
        Found in compass-style.org/assets/javascripts/install.js and 3 other locations - About 30 mins to fix
        compass-style.org/assets/javascripts/install.js on lines 75..76
        compass-style.org/assets/javascripts/install.js on lines 79..80
        compass-style.org/assets/javascripts/install.js on lines 81..82

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 45.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

                if ($("#jsdir").val() != "")
                  create_command += " --javascripts-dir \"" + $("#jsdir").val() + "\"";
        Severity: Major
        Found in compass-style.org/assets/javascripts/install.js and 3 other locations - About 30 mins to fix
        compass-style.org/assets/javascripts/install.js on lines 75..76
        compass-style.org/assets/javascripts/install.js on lines 77..78
        compass-style.org/assets/javascripts/install.js on lines 81..82

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 45.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Similar blocks of code found in 4 locations. Consider refactoring.
        Open

                if ($("#imagesdir").val() != "")
                  create_command += " --images-dir \"" + $("#imagesdir").val() + "\"";
        Severity: Major
        Found in compass-style.org/assets/javascripts/install.js and 3 other locations - About 30 mins to fix
        compass-style.org/assets/javascripts/install.js on lines 75..76
        compass-style.org/assets/javascripts/install.js on lines 77..78
        compass-style.org/assets/javascripts/install.js on lines 79..80

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 45.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Severity
        Category
        Status
        Source
        Language