chriseppstein/compass

View on GitHub

Showing 132 of 167 total issues

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 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

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

                def compile(sass_filename, css_filename, sourcemap_filename = nil)
                  css_content, sourcemap = logger.red do
                    timed(lambda {|r| r[0]}) do
                      engine = engine(sass_filename, css_filename, sourcemap_filename)
                      if sourcemap_filename && options[:sourcemap]
            Severity: Minor
            Found in cli/lib/compass/compiler.rb - About 55 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 url_join has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def url_join(*args)
                args.inject("") do |m, a|
                  m << "/" unless m.end_with?('/') || a.start_with?('/') if m.length > 0
                  m.gsub!(%r{/+$}, '') if a.start_with?('/')
                  m << a
            Severity: Minor
            Found in core/lib/compass/core/http_util.rb - About 55 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 expand_url_path has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def expand_url_path(url)
                # We remove the leading path otherwise we think there's an extra segment that can be removed
                prefix = "/" if url.start_with?("/")
                segments = url.gsub(%r{//+}, '/').split("/")
                segments.shift if prefix
            Severity: Minor
            Found in core/lib/compass/core/http_util.rb - About 55 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 headers has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def headers(from = nil, to = nil)
                if from && !to
                  if from.is_a?(Sass::Script::Value::String) && from.value == "all"
                    from = number(1)
                    to = number(6)
            Severity: Minor
            Found in core/lib/compass/core/sass_extensions/functions/selectors.rb - About 55 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 list_of_color_stops? has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def list_of_color_stops?(arg)
                  if arg.respond_to?(:value)
                    arg.value.is_a?(Array) && arg.value.all?{|a| color_stop?(a)} ? arg.value : nil
                  elsif arg.is_a?(Array)
                    arg.all?{|a| color_stop?(a)} ? arg : nil
            Severity: Minor
            Found in core/lib/compass/core/sass_extensions/functions/gradient_support.rb - About 55 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 debug has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                    def debug
                      normalized_attrs = {}
                      (ATTRIBUTES + ARRAY_ATTRIBUTES).each do |prop|
                        values = []
                        chain.each do |instance|
            Severity: Minor
            Found in core/lib/compass/configuration/inheritance.rb - About 55 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 execute has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                  def execute
                    if options[:custom]
                      version = ""
                      version << "#{Compass.version[:major]}" if options[:major]
                      version << ".#{Compass.version[:minor]}" if options[:minor]
            Severity: Minor
            Found in cli/lib/compass/commands/print_version.rb - About 55 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 radial_gradient has a Cognitive Complexity of 9 (exceeds 5 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 55 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 prefixed_usage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def prefixed_usage(prefix, capability, capability_options_list)
                assert_valid_prefix prefix
                assert_valid_capability capability
                usage = 0
                browsers_with_prefix(prefix).each do |browser|
            Severity: Minor
            Found in core/lib/compass/core/caniuse.rb - About 55 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 serialize_to_config has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                      def serialize_to_config(prop)
                        if v = @data.raw(prop)
                          "#{prop} = #{v.inspect}"
                        else
                          s = ""
            Severity: Minor
            Found in core/lib/compass/configuration/inheritance.rb - About 55 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 add_configuration_property has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                  def add_configuration_property(name, comment = nil, &default)
                    ATTRIBUTES << name
                    if comment.is_a?(String)
                      unless comment[0..0] == "#"
                        comment = "# #{comment}"
            Severity: Minor
            Found in core/lib/compass/configuration.rb - About 55 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 compass_extensions has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

              def compass_extensions
                exts = Sass::Util.ordered_hash(identifier("compass") => quoted_string(Compass::Core::VERSION))
                if defined?(Compass::Frameworks::ALL)
                  Compass::Frameworks::ALL.each do |framework|
                    next if framework.name == "compass"
            Severity: Minor
            Found in core/lib/compass/core/sass_extensions/functions/env.rb - About 55 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 convert_angle_from_offical has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
            Open

                def convert_angle_from_offical(deg)
                  if deg.is_a?(Sass::Script::Value::Number)
                    return number((deg.value.to_f - 450).abs % 360, 'deg')
                  else
                    args = deg.value
            Severity: Minor
            Found in core/lib/compass/core/sass_extensions/functions/gradient_support.rb - About 55 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 new has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

                def self.new(*args)
                  instance = super
                  instance.extend(Compass::ImportOnce::Engine)
                  if i = instance.options[:importer]
                    i.extend(Compass::ImportOnce::Importer) unless i.is_a?(Compass::ImportOnce::Importer)
            Severity: Minor
            Found in import-once/lib/compass/import-once/activate.rb - About 45 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 all_mixins has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            def all_mixins
              @items.inject([]) do |all_mixins, item|
                next all_mixins unless item.identifier =~ %r{/reference}
                next all_mixins unless item[:stylesheet]
                all_mixins += mixins(item).map{|m| [item, m] }
            Severity: Minor
            Found in compass-style.org/lib/stylesheets.rb - About 45 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