trombik/qansible

View on GitHub

Showing 26 of 26 total issues

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

      def initialize(_options)
        @logger = Logger.new($stdout)
        @logger.level = Logger::DEBUG
        @logger.formatter = proc do |severity, _datetime, _progname, msg|
          if silent?
Severity: Minor
Found in lib/qansible/commands/base.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 must_have_mandatory_keys_in_galaxy_info has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def must_have_mandatory_keys_in_galaxy_info
        load_yaml unless @yaml
        mandatory_keys = %w[
          author
          company
Severity: Minor
Found in lib/qansible/checks/meta_main_yml.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 check has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

      def check
        raise_at_end = false
        raise_at_end = true unless must_have_all_directories
        raise_at_end = true unless must_have_keepme_in_all_directories
        raise_at_end = true unless must_not_have_test
Severity: Minor
Found in lib/qansible/checks/hier.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 validate_role_name has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def validate_role_name(name)
        raise InvalidRoleName, "No role name given" unless name
        raise InvalidRoleName, "Invalid role name `%s` given. Role name mus start with `ansible-role`" % [name] unless name =~ /^ansible-role-/

        valid_regex = /^[a-zA-Z0-9\-_]+$/
Severity: Minor
Found in lib/qansible/commands/init.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 colorize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def colorize(text, color = "default", bgcolor = "default")
        return text unless tty?

        colors = {
          "default" => "38",
Severity: Minor
Found in lib/qansible/commands/base.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 colorize has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

      def colorize(text, color = "default", bgcolor = "default")
        return text unless tty?

        colors = {
          "default" => "38",
Severity: Minor
Found in lib/qansible/checks/base_check.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