ShogunPanda/bovem

View on GitHub

Showing 48 of 48 total issues

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

    def set(value, raise_error = true)
      vs = get_validator_method(@validator)
      rv = vs ? @validator.send(vs, value) : true

      if rv
Severity: Minor
Found in lib/bovem/option.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 normalize_patterns has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def normalize_patterns(patterns, by_extension, case_sensitive)
        # Adjust patterns
        patterns = patterns.ensure_array(no_duplicates: true, compact: true, flatten: true) do |p|
          p.is_a?(::Regexp) ? p : Regexp.new(Regexp.quote(p.ensure_string))
        end
Severity: Minor
Found in lib/bovem/shell.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 handle_command_exit has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def handle_command_exit(rv, show_exit, fatal_errors)
        @console.status(rv[:status] == 0 ? :ok : :fail) if show_exit
        exit(rv[:status]) if fatal_errors && rv[:status] != 0
      end
Severity: Minor
Found in lib/bovem/shell.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 read_configuration_file has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def read_configuration_file(file, logger)
      # Open the file
      path = file =~ /^#{File::SEPARATOR}/ ? file : ::Pathname.new(file).realpath
      logger.info(i18n.using(path)) if logger
      eval_file(path)
Severity: Minor
Found in lib/bovem/configuration.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 setup_with has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

    def setup_with(options = {})
      options = {} unless options.is_a?(::Hash)
      setup_i18n(options)

      options.each_pair do |option, value|
Severity: Minor
Found in lib/bovem/command.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 enter_directory has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def enter_directory(directory, show_message, message)
        raise ArgumentError unless check(directory, :directory, :executable)
        @console.info(message) if show_message
        Dir.chdir(directory)
        true
Severity: Minor
Found in lib/bovem/shell.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 add_style has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def add_style(styles, plain, stack)
          styles = styles.ensure_string
          replacement = plain ? "" : Bovem::Console.parse_styles(styles)

          unless replacement.empty?
Severity: Minor
Found in lib/bovem/console.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 wrap has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def wrap(message, width = nil)
        if width.to_integer <= 0
          message
        else
          width = (width == true || width.to_integer < 0 ? line_width : width.to_integer)
Severity: Minor
Found in lib/bovem/console.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