Showing 92 of 92 total issues
Class has too many lines. [152/100] Open
class IssueCLI < BaseCLI
no_commands do
def client_class
Client::Issue
end
- Read upRead up
- Exclude checks
This cop checks if the length a class exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for suggest_options is too high. [42.94/20] Open
def suggest_options(opts = {})
origin = options.dup
self.with_editor = origin.delete(:editor)
if opts[:required].is_a? Array
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for redner_project_detail is too high. [32.31/20] Open
def redner_project_detail(project)
head = nil
rows = []
rows << (pastel.blue.bold(project.key) + ' ' + project.name)
if project.respond_to?(:description)
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Method has too many lines. [39/30] Open
def issue_detail_template
%{<%= bold(issue.key) + ' in ' + issue.project.name %>
<%= bold(issue.summary) %>
- Read upRead up
- Exclude checks
This cop checks if the length of a method exceeds some maximum value. Comment lines can optionally be ignored. The maximum allowed length is configurable.
Assignment Branch Condition size for build_auth_options_by_tty is too high. [28.44/20] Open
def build_auth_options_by_tty(options = {})
puts 'Login will be required...'
prompt = TTY::Prompt.new
result = prompt.collect do
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for new_version_exists? is too high. [23.96/20] Open
def new_version_exists?
current = Terjira::VERSION.split(".").map(&:to_i)
remote = parse_remote_version
(current[0] < remote[0]) ||
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Assignment Branch Condition size for suggest_related_value_options is too high. [22.2/20] Open
def suggest_related_value_options(opts = {})
if opts[:issuetype]
if opts[:issuetype].key_value.casecmp('epic').zero?
# Suggest epic name
epic_name_field = Client::Field.epic_name
- Read upRead up
- Exclude checks
This cop checks that the ABC size of methods is not higher than the configured maximum. The ABC size is based on assignments, branches (method calls), and conditions. See http://c2.com/cgi/wiki?AbcMetric
Cyclomatic complexity for new_version_exists? is too high. [7/6] Open
def new_version_exists?
current = Terjira::VERSION.split(".").map(&:to_i)
remote = parse_remote_version
(current[0] < remote[0]) ||
- Read upRead up
- Exclude checks
This cop checks that the cyclomatic complexity of methods is not higher than the configured maximum. The cyclomatic complexity is the number of linearly independent paths through a method. The algorithm counts decision points and adds one.
An if statement (or unless or ?:) increases the complexity by one. An else branch does not, since it doesn't add a decision point. The && operator (or keyword and) can be converted to a nested if statement, and ||/or is shorthand for a sequence of ifs, so they also add one. Loops can be said to have an exit condition, so they add one.
Method issue_detail_template
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
def issue_detail_template
%{<%= bold(issue.key) + ' in ' + issue.project.name %>
<%= bold(issue.summary) %>
Method purge_dir
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def purge_dir(dir)
Dir.foreach(dir) do |f|
next if f =~ /^\.\.?$/
path = File.join(dir, f)
if File.directory?(path)
- 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 suggest_related_value_options
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def suggest_related_value_options(opts = {})
if opts[:issuetype]
if opts[:issuetype].key_value.casecmp('epic').zero?
# Suggest epic name
epic_name_field = Client::Field.epic_name
- 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 suggest_options
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def suggest_options(opts = {})
origin = options.dup
self.with_editor = origin.delete(:editor)
if opts[:required].is_a? Array
Method select_issue_status
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def select_issue_status
fetch(:status) do
statuses = fetch(:statuses) do
project = if issue = get(:issue)
if issue.respond_to?(:project)
- 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 colorize_priority
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def colorize_priority(priority, opts = {})
return '' unless priority.respond_to? :name
name = priority.name
infos = if name =~ /high|major|critic/i
[:red, '⬆']
- 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 option_select_prompt
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def option_select_prompt
return @_option_select_prompt if @_option_select_prompt
@_option_select_prompt = TTY::Prompt.new(help_color: :cyan)
@_option_select_prompt.on(:keypress) do |event|
# emacs key binding
- 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 insert_new_line
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def insert_new_line(str, length)
str.split(/\r\n|\n/).map do |line|
line.strip!
if line.display_width < 1
line
- 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 suggest_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def suggest_options(opts = {})
origin = options.dup
self.with_editor = origin.delete(:editor)
if opts[:required].is_a? Array
- 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 issue_estimate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def issue_estimate(issue)
field = Client::Field.story_points
story_points = issue.try(field.key) if field.respond_to? :key
return ['Story Points', story_points] if story_points
- 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 select_assignee
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def select_assignee
fetch(:assignee) do
users = fetch(:users) do
if issue = get(:issue)
Client::User.assignables_by_issue(issue)
- 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 render_projects_summary
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def render_projects_summary(projects)
return render('Nothing.') if projects.blank?
head = %w(KEY NAME TYPE).map do |v|
{ value: v, alignment: :center }
end
- 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"