ronin-rb/ronin-support

View on GitHub
lib/ronin/support/cli/ansi.rb

Summary

Maintainability
A
3 hrs
Test Coverage

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

        def yellow(string=nil)
          if string
            if $stdout.tty? then "#{YELLOW}#{string}#{RESET_COLOR}"
            else                 string
            end
Severity: Minor
Found in lib/ronin/support/cli/ansi.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 black has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def black(string=nil)
          if string
            if $stdout.tty? then "#{BLACK}#{string}#{RESET_COLOR}"
            else                 string
            end
Severity: Minor
Found in lib/ronin/support/cli/ansi.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 blue has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def blue(string=nil)
          if string
            if $stdout.tty? then "#{BLUE}#{string}#{RESET_COLOR}"
            else                 string
            end
Severity: Minor
Found in lib/ronin/support/cli/ansi.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 bold has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def bold(string=nil)
          if string
            if $stdout.tty? then "#{BOLD_ON}#{string}#{BOLD_OFF}"
            else                 string
            end
Severity: Minor
Found in lib/ronin/support/cli/ansi.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 red has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def red(string=nil)
          if string
            if $stdout.tty? then "#{RED}#{string}#{RESET_COLOR}"
            else                 string
            end
Severity: Minor
Found in lib/ronin/support/cli/ansi.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 magenta has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def magenta(string=nil)
          if string
            if $stdout.tty? then "#{MAGENTA}#{string}#{RESET_COLOR}"
            else                 string
            end
Severity: Minor
Found in lib/ronin/support/cli/ansi.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 white has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def white(string=nil)
          if string
            if $stdout.tty? then "#{WHITE}#{string}#{RESET_COLOR}"
            else                 string
            end
Severity: Minor
Found in lib/ronin/support/cli/ansi.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 cyan has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def cyan(string=nil)
          if string
            if $stdout.tty? then "#{CYAN}#{string}#{RESET_COLOR}"
            else                 string
            end
Severity: Minor
Found in lib/ronin/support/cli/ansi.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 green has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

        def green(string=nil)
          if string
            if $stdout.tty? then "#{GREEN}#{string}#{RESET_COLOR}"
            else                 string
            end
Severity: Minor
Found in lib/ronin/support/cli/ansi.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

There are no issues that match your filters.

Category
Status