Compass/compass

View on GitHub

Showing 168 of 168 total issues

Method grad_point has 32 lines of code (exceeds 25 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
Severity: Minor
Found in core/lib/compass/core/sass_extensions/functions/gradient_support.rb - About 1 hr to fix

    Method configuration_for has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

          def configuration_for(config, filename = nil, defaults = nil)
            if config.nil?
              nil
            elsif config.is_a?(Compass::Configuration::Data)
              config
    Severity: Minor
    Found in cli/lib/compass/configuration/helpers.rb - About 1 hr 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 compute_cache_buster has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
    Open

      def compute_cache_buster(path, real_path)
        file = nil
        if Compass.configuration.asset_cache_buster
          args = [path]
          if Compass.configuration.asset_cache_buster.arity > 1
    Severity: Minor
    Found in core/lib/compass/core/sass_extensions/functions/urls.rb - About 1 hr 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

    Function Brush has 31 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        function Brush()
        {
            function process(match, regexInfo)
            {
                var constructor = SyntaxHighlighter.Match,
    Severity: Minor
    Found in compass-style.org/assets/javascripts/shBrushXml.js - About 1 hr to fix

      Method perform has 31 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

            def perform
              if options[:display]
                if Compass.configuration.respond_to?(options[:display])
                  puts Compass.configuration.send(options[:display])
                else
      Severity: Minor
      Found in cli/lib/compass/commands/write_configuration.rb - About 1 hr to fix

        Method normalize_stops has 29 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

            def normalize_stops(color_list)
              positions = color_list.value.map{|obj| obj.dup}
              # fill in the start and end positions, if unspecified
              positions.first.stop = number(0) unless positions.first.stop
              positions.last.stop = number(100, "%") unless positions.last.stop
        Severity: Minor
        Found in core/lib/compass/core/sass_extensions/functions/gradient_support.rb - About 1 hr to fix

          Method sprite_position has 29 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

            def sprite_position(map, sprite = nil, offset_x = ZERO, offset_y = ZERO, use_percentages = BOOL_FALSE)
              assert_type offset_x, :Number
              assert_type offset_y, :Number
              sprite = convert_sprite_name(sprite)
              verify_map(map, "sprite-position")
          Severity: Minor
          Found in cli/lib/compass/sass_extensions/functions/sprites.rb - About 1 hr to fix

            Method pretty_print has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                def pretty_print(skip_patterns = false)
                  result = ""
                  max = Compass::Frameworks::ALL.inject(0) do |gm, framework|
                    fm = framework.template_directories.inject(0) do |lm,pattern|
                      [lm, 7 + framework.name.size + pattern.size].max
            Severity: Minor
            Found in core/lib/compass/frameworks.rb - About 1 hr 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_string has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                  def parse_string(contents, filename)
                    bind = get_binding
                    eval(contents, bind, filename)
                    local_vars_set = eval("local_variables", bind)
                    local_vars_set.each do |local_var|
            Severity: Minor
            Found in cli/lib/compass/configuration/serialization.rb - About 1 hr 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 functions has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            def functions(item)
              sass_tree = tree(item)
              functions = []
              comment = nil
              sass_tree.children.each do |child|
            Severity: Minor
            Found in compass-style.org/lib/stylesheets.rb - About 1 hr 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 sass_load_paths has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

                  def sass_load_paths
                    load_paths = []
                    load_paths << sass_path if sass_path && File.directory?(sass_path)
                    Compass::Frameworks::ALL.each do |f|
                      load_paths << f.stylesheets_directory if File.directory?(f.stylesheets_directory)
            Severity: Minor
            Found in core/lib/compass/configuration/adapters.rb - About 1 hr 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 requires_prefix has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

              def requires_prefix(browser, min_version, capability, capability_options_list)
                min_version = caniuse_version(browser, min_version)
                assert_valid_browser browser
                assert_valid_capability capability
                found_version = false
            Severity: Minor
            Found in core/lib/compass/core/caniuse.rb - About 1 hr 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 constants has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

            def constants(item)
              sass_tree = tree(item)
              constants = []
              comment = nil
              sass_tree.children.each do |child|
            Severity: Minor
            Found in compass-style.org/lib/stylesheets.rb - About 1 hr 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 prefix has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring.
            Open

              def prefix(prefix, *objects)
                assert_type prefix, :String if prefix.is_a?(Sass::Script::Value::Base)
                prefix = prefix.value if prefix.is_a?(Sass::Script::Value::String)
                prefix = prefix[1..-1] if prefix[0] == ?-
                if objects.size > 1

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

            def mixins(item)
              sass_tree = tree(item)
              mixins = []
              comment = nil
              sass_tree.children.each do |child|
            Severity: Minor
            Found in compass-style.org/lib/stylesheets.rb - About 1 hr 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 radial_gradient has 27 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                def radial_gradient(position_or_angle, shape_and_size, *color_stops)
                  # Have to deal with variable length/meaning arguments.
                  if color_stop?(shape_and_size)
                    color_stops.unshift(shape_and_size)
                    shape_and_size = nil
            Severity: Minor
            Found in core/lib/compass/core/sass_extensions/functions/gradient_support.rb - About 1 hr to fix

              Method examine has 27 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                  def examine(io)
                    class << io
                      unless method_defined?(:readbyte)
                        def readbyte
                          getc
              Severity: Minor
              Found in core/lib/compass/core/sass_extensions/functions/image_size.rb - About 1 hr to fix

                Method to_sass_plugin_options has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                      def to_sass_plugin_options
                        locations = []
                        locations << [sass_path, css_path] if sass_path && css_path
                        Compass::Frameworks::ALL.each do |framework|
                          locations << [framework.stylesheets_directory, File.join(css_path || css_dir || ".", framework.name)]
                Severity: Minor
                Found in core/lib/compass/configuration/adapters.rb - About 1 hr to fix

                  Method search_index has 26 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

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

                    Method write_file has 26 lines of code (exceeds 25 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)
                    Severity: Minor
                    Found in cli/lib/compass/actions.rb - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language