zmoazeni/csscss

View on GitHub

Showing 8 of 13 total issues

Method redundancies has a Cognitive Complexity of 43 (exceeds 5 allowed). Consider refactoring.
Open

    def redundancies(opts = {})
      minimum            = opts[:minimum]
      ignored_properties = opts[:ignored_properties] || []
      ignored_selectors  = opts[:ignored_selectors] || []
      match_shorthand    = opts.fetch(:match_shorthand, true)
Severity: Minor
Found in lib/csscss/redundancy_analyzer.rb - About 6 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 execute has a Cognitive Complexity of 27 (exceeds 5 allowed). Consider refactoring.
Open

    def execute
      deprecate("Use --show-parser-errors instead of CSSCSS_DEBUG") if ENV["CSSCSS_DEBUG"]

      all_contents= @argv.map do |filename|
        if filename =~ URI.regexp
Severity: Minor
Found in lib/csscss/cli.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 redundancies has 93 lines of code (exceeds 25 allowed). Consider refactoring.
Open

    def redundancies(opts = {})
      minimum            = opts[:minimum]
      ignored_properties = opts[:ignored_properties] || []
      ignored_selectors  = opts[:ignored_selectors] || []
      match_shorthand    = opts.fetch(:match_shorthand, true)
Severity: Major
Found in lib/csscss/redundancy_analyzer.rb - About 3 hrs to fix

    Method parse has 54 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        def parse(argv)
          options = OptionParser.new do |opts|
            opts.banner  = "Usage: csscss [files..]"
            opts.version = Csscss::VERSION
    
    
    Severity: Major
    Found in lib/csscss/cli.rb - About 2 hrs to fix

      Method execute has 38 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

          def execute
            deprecate("Use --show-parser-errors instead of CSSCSS_DEBUG") if ENV["CSSCSS_DEBUG"]
      
            all_contents= @argv.map do |filename|
              if filename =~ URI.regexp
      Severity: Minor
      Found in lib/csscss/cli.rb - About 1 hr to fix

        Method load_sass_file has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
        Open

            def load_sass_file(filename)
              abort 'Must install the "sass" gem before parsing sass/scss files' unless gem_installed?("sass")
              require "csscss/sass_include_extensions" if @ignore_sass_mixins
        
              sass_options = {cache:false}
        Severity: Minor
        Found in lib/csscss/cli.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 parse has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
        Open

            def parse(argv)
              options = OptionParser.new do |opts|
                opts.banner  = "Usage: csscss [files..]"
                opts.version = Csscss::VERSION
        
        
        Severity: Minor
        Found in lib/csscss/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 transform_side has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
        Open

                  def transform_side(side, context)
                    width = context[:width]
                    style = context[:style]
                    color = context[:color]
        
        
        Severity: Minor
        Found in lib/csscss/parser/border_side.rb - About 25 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