sds/scss-lint

View on GitHub
lib/scss_lint/cli.rb

Summary

Maintainability
A
3 hrs
Test Coverage

Method handle_runtime_exception has 47 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def handle_runtime_exception(exception, options) # rubocop:disable Metrics/AbcSize, Metrics/CyclomaticComplexity, Metrics/LineLength, Metrics/MethodLength
      case exception
      when SCSSLint::Exceptions::InvalidCLIOption
        log.error exception.message
        log.info 'Run `scss-lint --help` for usage documentation'
Severity: Minor
Found in lib/scss_lint/cli.rb - About 1 hr to fix

    Method act_on_options has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def act_on_options(options)
          log.color_enabled = options.fetch(:color, log.tty?)
          load_required_paths(options)
          load_reporters(options)
    
    
    Severity: Minor
    Found in lib/scss_lint/cli.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 report_lints has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
    Open

        def report_lints(options, lints, files)
          sorted_lints = lints.sort_by { |l| [l.filename, l.location] }
          options.fetch(:reporters).each do |reporter, output|
            results = reporter.new(sorted_lints, files, log).report_lints
            next unless results
    Severity: Minor
    Found in lib/scss_lint/cli.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