Compass/compass

View on GitHub

Showing 134 of 168 total issues

File gradient_support.rb has 721 lines of code (exceeds 250 allowed). Consider refactoring.
Open

module Compass::Core::SassExtensions::Functions::GradientSupport

  GRADIENT_ASPECTS = %w(webkit moz svg css2 o owg).freeze

  class CSS3AngleToSVGConverter
Severity: Major
Found in core/lib/compass/core/sass_extensions/functions/gradient_support.rb - About 1 day to fix

    Function showInstallCommand has a Cognitive Complexity of 37 (exceeds 5 allowed). Consider refactoring.
    Open

    function showInstallCommand() {
        var cmd = $("#existence").val();
        var commands = [];
        var notes = [];
        var project_name = "<myproject>";
    Severity: Minor
    Found in compass-style.org/assets/javascripts/install.js - About 5 hrs 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_sass_configuration has a Cognitive Complexity of 31 (exceeds 5 allowed). Consider refactoring.
    Open

      def add_sass_configuration(project_path)
        css_location = template_location = nil
        if options[:template_location] && options[:template_location].is_a?(Array)
          css_location = File.expand_path(options[:template_location].first.last)
          template_location = File.expand_path(options[:template_location].first.first)
    Severity: Minor
    Found in core/lib/compass/core/sass_extensions/functions/configuration.rb - About 4 hrs 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 cookie has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

    jQuery.cookie = function(name, value, options) {
        if (typeof value != 'undefined') { // name and value given, set cookie
            options = options || {};
            if (value === null) {
                value = '';
    Severity: Minor
    Found in compass-style.org/assets/javascripts/jquery.cookie.js - About 4 hrs 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 image_url has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring.
    Open

        def image_url(path, only_path = bool(false), cache_buster = bool(true))
          path = path.value # get to the string value of the literal.
    
          if path =~ %r{^#{Regexp.escape(Compass.configuration.http_images_path)}/(.*)}
            # Treat root relative urls (without a protocol) like normal if they start with
    Severity: Minor
    Found in core/lib/compass/core/sass_extensions/functions/urls.rb - About 4 hrs 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 28 (exceeds 5 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 4 hrs 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 generated_image_url has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
    Open

        def generated_image_url(path, cache_buster = bool(false))
          path = path.value # get to the string value of the literal.
    
          if path =~ %r{^#{Regexp.escape(Compass.configuration.http_generated_images_path)}/(.*)}
            # Treat root relative urls (without a protocol) like normal if they start with
    Severity: Minor
    Found in core/lib/compass/core/sass_extensions/functions/urls.rb - About 3 hrs 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 font_url has a Cognitive Complexity of 26 (exceeds 5 allowed). Consider refactoring.
    Open

        def font_url(path, only_path = bool(false), cache_buster = bool(true))
          path = path.value # get to the string value of the literal.
    
          # Short curcuit if they have provided an absolute url.
          if absolute_path?(path)
    Severity: Minor
    Found in core/lib/compass/core/sass_extensions/functions/urls.rb - About 3 hrs 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 showInstallCommand has 93 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function showInstallCommand() {
        var cmd = $("#existence").val();
        var commands = [];
        var notes = [];
        var project_name = "<myproject>";
    Severity: Major
    Found in compass-style.org/assets/javascripts/install.js - About 3 hrs to fix

      Method normalize_stops has a Cognitive Complexity of 25 (exceeds 5 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 3 hrs 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 sprite_position has a Cognitive Complexity of 24 (exceeds 5 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 3 hrs 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 item_tree has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring.
      Open

      def item_tree(item, options = {})
        crumb = item[:crumb] || item[:title]
        options[:heading_level] ||= 1 if options.fetch(:headings, true)
        child_html = ""
        if options.fetch(:depth,1) > 0
      Severity: Minor
      Found in compass-style.org/lib/default.rb - About 3 hrs 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

      Class Image has 26 methods (exceeds 20 allowed). Consider refactoring.
      Open

            class Image
              include Sass::Script::Value::Helpers
              ACTIVE = %r{[_-]active$}
              TARGET = %r{[_-]target$}
              HOVER = %r{[_-]hover$}
      Severity: Minor
      Found in cli/lib/compass/sass_extensions/sprites/image.rb - About 3 hrs to fix

        Class CanIUse has 26 methods (exceeds 20 allowed). Consider refactoring.
        Open

        class Compass::Core::CanIUse
          include Singleton
        
          DATA_FILE_NAME = File.join(Compass::Core.base_directory, "data", "caniuse.json")
          DATA_FEATURE_FILES = Dir.glob(File.join(Compass::Core.base_directory, "data", "caniuse_extras", "**", "*.json"))
        Severity: Minor
        Found in core/lib/compass/core/caniuse.rb - About 3 hrs to fix

          Class Compiler has 26 methods (exceeds 20 allowed). Consider refactoring.
          Open

            class Compiler
          
              include Actions
          
              attr_accessor :working_path, :from, :to, :options, :sass_options, :staleness_checker, :importer
          Severity: Minor
          Found in cli/lib/compass/compiler.rb - About 3 hrs to fix

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

                function Brush()
                {
                    function getKeywordsCSS(str)
                    {
                        return '\\b([a-z_]|)' + str.replace(/ /g, '(?=:)\\b|\\b([a-z_\\*]|\\*|)') + '(?=:)\\b';
            Severity: Major
            Found in compass-style.org/assets/javascripts/shBrushSass.js - About 2 hrs to fix

              Method handle_keywords has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                  def handle_keywords(angle)
                    if angle.is_a?(Sass::Script::Value::List) || angle.is_a?(Sass::Script::Value::String)
                      direction = angle.to_sass
                      is_end_point = !!/\bto\b/i.match(direction)
                      dir = 0
              Severity: Minor
              Found in core/lib/compass/core/sass_extensions/functions/gradient_support.rb - About 2 hrs 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 scan_fit has a Cognitive Complexity of 18 (exceeds 5 allowed). Consider refactoring.
              Open

                      def scan_fit
                        fast_fit
              
                        moved_images = []
              
              
              Severity: Minor
              Found in cli/lib/compass/sass_extensions/sprites/row_fitter.rb - About 2 hrs 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

              File inheritance.rb has 263 lines of code (exceeds 250 allowed). Consider refactoring.
              Open

              module Compass
                module Configuration
                  # The inheritance module makes it easy for configuration data to inherit from
                  # other instances of configuration data. This makes it easier for external code to layer
                  # bits of configuration from various sources.
              Severity: Minor
              Found in core/lib/compass/configuration/inheritance.rb - About 2 hrs to fix

                Method opposite_position has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
                Open

                  def opposite_position(position)
                    position = unless position.is_a?(Sass::Script::Value::List)
                      list(position, :space)
                    else
                      list(position.value.dup, position.separator)
                Severity: Minor
                Found in core/lib/compass/core/sass_extensions/functions/constants.rb - About 2 hrs 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