Showing 5 of 36 total issues
Class Output
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Output < Mustache
@@template_format = 'txt'
self.template_path = format('%<dir>s/output', dir: File.dirname(__FILE__))
self.template_file = format('%<dir>s/output/output_%<format>s.mustache', dir: File.dirname(__FILE__), format: @@template_format)
Method get_revisions_from_lines
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def get_revisions_from_lines(lines, search = nil, branch = nil, limit = nil)
check_type __callee__, 'lines', lines.is_a?(Array)
lines.each_with_index do |line, index|
check_type __callee__, format('lines[%<index>d]', index: index), line.is_a?(String)
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"
Further reading
Method issue_links
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def issue_links
return unless context.current[:info]
case context.current[:type]
when :commit
return unless context.current[:info][:commit]
- 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 add_dates_to_revisions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def add_dates_to_revisions(revisions, github, git_user = nil, git_repo = nil)
check_type __callee__, 'revisions', revisions.is_a?(Hash)
check_type __callee__, 'github', github.is_a?(Capistrano::Committed::GithubApi)
git_user = check_git_user(git_user)
git_repo = check_git_repo(git_repo)
- 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 item_link
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def item_link
return unless context.current[:info]
case context.current[:type]
when :commit, :pull_request
return unless context.current[:info][:html_url]
- 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"