Showing 4 of 4 total issues
Method mount_banner
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
def mount_banner
version_number = VERSION
Optimist::Parser.new do
version "Bumpversion #{version_number} ☺"
usage "bumpversion [options] --part [major|minor|patch]
- Create a ticketCreate a ticket
Method merge
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def merge(options, parseconfig)
parseconfig.each do |key, value|
key = key.tr('-', '_')
key_given = "#{key}_given"
key_given_file = "#{key_given}_file"
- Read upRead up
- Create a ticketCreate a ticket
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 bump
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def bump
unless @options[:new_version]
actual_version = matched.named_captures.reject { |k,v| v.nil? }.map { |k, v| [k.to_sym, v.to_i] }.to_h
matched_version = update_version(actual_version)
new_version = pattern_replace.match(@options[:current_version]).named_captures.map do |k, v|
- Read upRead up
- Create a ticketCreate a ticket
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 update_version
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_version(matched_version)
bumped = false
matched_version.each do | part, number |
matched_version[part] = 0 if bumped && part.to_sym != :build
- Read upRead up
- Create a ticketCreate a ticket
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"