lib/polisher/cli/targets.rb
Method targets_options
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
Open
def targets_options(option_parser)
option_parser.on('-p', '--prefix prefix', 'Prefix to append to gem name') do |p|
conf[:prefix] = p
end
Method configure_targets
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def configure_targets(conf)
if conf[:check_koji]
require 'polisher/targets/koji'
Polisher::Koji.koji_url conf[:check_koji] if conf[:check_koji].is_a?(String)
Polisher::Koji.koji_tags conf[:koji_tags] if conf[:koji_tags]
- Read upRead up
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 set_targets
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
Open
def set_targets(conf)
targets = []
require 'polisher/adaptors/version_checker'
targets << :gem if conf[:check_gem]
targets << :koji if conf[:check_koji]
- Read upRead up
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"