Showing 48 of 48 total issues
Method revisions_in_chunks
has a Cognitive Complexity of 53 (exceeds 5 allowed). Consider refactoring. Open
def revisions_in_chunks(path, identifier_from, identifier_to, options = {}, &block)
revision_regexp = %r{
(?<h>[0-9a-f]{40});\s
(?<ai>.*);\s
- 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 entries
has a Cognitive Complexity of 48 (exceeds 5 allowed). Consider refactoring. Open
def entries(path, identifier = nil, options = {})
path ||= ''
p = scm_iconv(path_encoding, 'UTF-8', path)
entries = Entries.new
cmd_args = %w{ls-tree -l}
- 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
File undev_git_adapter.rb
has 417 lines of code (exceeds 250 allowed). Consider refactoring. Open
require_dependency 'redmine/scm/adapters/git_adapter'
require_dependency 'redmine/scm/adapters/undev_git_revision'
module Redmine::Scm::Adapters
class UndevGitAdapter < AbstractAdapter
Class RemoteRepoFetch
has 42 methods (exceeds 20 allowed). Consider refactoring. Open
class RemoteRepoFetch
attr_reader :repo
HookRequest = Struct.new(:issue, :hook, :repo_revision, :keyword, :branch) do
def valid?
Method revisions
has a Cognitive Complexity of 29 (exceeds 5 allowed). Consider refactoring. Open
def revisions(include_revs = nil, exclude_revs = nil, options = {})
# :sha %H
# :author %an %ae
# :author_date %ai
- 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
Class UndevGitAdapter
has 29 methods (exceeds 20 allowed). Consider refactoring. Open
class UndevGitAdapter < AbstractAdapter
include RedmineUndevGit::Includes::GitShell
# Git executable name
File remote_repo_fetch.rb
has 311 lines of code (exceeds 250 allowed). Consider refactoring. Open
module RedmineUndevGit::Services
# fetch remote repository
class RemoteRepoFetch
attr_reader :repo
Method revisions_in_chunks
has 71 lines of code (exceeds 25 allowed). Consider refactoring. Open
def revisions_in_chunks(path, identifier_from, identifier_to, options = {}, &block)
revision_regexp = %r{
(?<h>[0-9a-f]{40});\s
(?<ai>.*);\s
Method parse_comment_for_issues
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def parse_comment_for_issues(ref_keywords, fix_keywords)
ret = { ref_issues: [], fix_issues: {}, log_time: {} }
return ret if comments.blank?
- 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 apply_hooks_for_merged_commits
has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring. Open
def apply_hooks_for_merged_commits(prev_branches, repo_branches)
return unless initialization_done? || use_init_hooks?
all_hooks = all_applicable_hooks.find_all { |b| !b.any_branch? }
hook_branches = all_hooks.map(&:branches).flatten.uniq
- 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 run_migration
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
def run_migration
mappings.each_with_index do |m, i|
puts "#{i}/#{mappings.count} Processing #{m.old_repo}"
if m.new_repo.url.blank?
- 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 apply_hooks_to_issue_by_repo_revision
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def apply_hooks_to_issue_by_repo_revision(issue_id, action, repo_revision)
issue = Issue.find_by_id(issue_id)
unless Policies::ApplyHooks.allowed?(repo_revision.committer, 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 revisions
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def revisions(include_revs = nil, exclude_revs = nil, options = {})
# :sha %H
# :author %an %ae
# :author_date %ai
Method run_migration
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def run_migration
mappings.each_with_index do |m, i|
puts "#{i}/#{mappings.count} Processing #{m.old_repo}"
if m.new_repo.url.blank?
Method revisions
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
def revisions(path, identifier_from, identifier_to, options = {}, &block)
if block_given?
raise 'Can' 't read chunks with reverse option' if options[:reverse]
revisions_in_chunks(path, identifier_from, identifier_to, options, &block)
else
- 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 revisions_for_git_cmd
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def revisions_for_git_cmd(options = {})
revisions = []
identifier_from, identifier_to = options[:identifier_from], options[:identifier_to]
if identifier_from || identifier_to
revisions << ''
- 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 chunked_git_log
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
def chunked_git_log(path, options, &block)
skip = 0
revisions = revisions_for_git_cmd(options)
- 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 entries
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def entries(path, identifier = nil, options = {})
path ||= ''
p = scm_iconv(path_encoding, 'UTF-8', path)
entries = Entries.new
cmd_args = %w{ls-tree -l}
Method hook_column_value
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def hook_column_value(column_name, value)
case value.class.name
when 'Symbol'
l(value)
when 'String'
Method chunked_git_log
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
def chunked_git_log(path, options, &block)
skip = 0
revisions = revisions_for_git_cmd(options)