chriseppstein/compass

View on GitHub
cli/lib/compass/compiler.rb

Summary

Maintainability
B
5 hrs
Test Coverage

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

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

        def compile_if_required(sass_filename, css_filename, sourcemap_filename = nil)
          if should_compile?(sass_filename, css_filename, sourcemap_filename)
            compile sass_filename, css_filename, sourcemap_filename
          else
            logger.record :unchanged, basename(sass_filename) unless options[:quiet]
    Severity: Minor
    Found in cli/lib/compass/compiler.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 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

    There are no issues that match your filters.

    Category
    Status