Showing 26 of 32 total issues

Method _use_default has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def _use_default
        DEFAULT_GUARDFILES.each do |guardfile|
          @guardfile_path, @contents = _read(guardfile)
          break
        rescue Errno::ENOENT
Severity: Minor
Found in lib/guard/guardfile/evaluator.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

Method process has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

          def process(*entries) # rubocop:disable Lint/NestedMethodDefinition
            session = engine.session
            scopes, = session.convert_scopes([])

            if entries != ["all"]
Severity: Minor
Found in lib/guard/commands/scope.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

Method _prompt has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def _prompt(ending_char)
        proc do |target_self, nest_level, pry|
          process = engine.paused? ? "pause" : "guard"
          level = ":#{nest_level}" unless nest_level.zero?

Severity: Minor
Found in lib/guard/jobs/pry_wrapper.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

Method _filter has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def _filter(plugin)
        only = options.only
        except = options.except
        plugin ||= _calling_plugin_name

Severity: Minor
Found in lib/guard/ui.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

Method scope_titles has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def scope_titles(entries = [])
        scopes, = convert_scopes(entries)

        if scopes[:plugins].any?
          objects = _retrieve_plugins(scopes)
Severity: Minor
Found in lib/guard/internals/session.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

Method initialize_template has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def initialize_template(plugin_name)
        guardfile = Pathname.new("Guardfile")
        plugin_util = PluginUtil.new(plugin_name)

        if plugin_util.valid?
Severity: Minor
Found in lib/guard/guardfile/generator.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