Showing 72 of 72 total issues
Method lastrev
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
def lastrev(path, rev)
return if path.nil?
cmd_args = %w[log --no-color --encoding=UTF-8 --date=iso --pretty=fuller --no-merges -n 1]
cmd_args << '--no-renames' if self.class.client_version_above? [2, 9]
- 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 commits_per_author_with_aliases
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
def commits_per_author_with_aliases
return @commits_per_author_with_aliases unless @commits_per_author_with_aliases.nil?
@commits_per_author_with_aliases = nil
Method validate_revision
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
def validate_revision
commit = nil
# is the revision a branch?
repository.branches.each do |x|
- 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 annotate
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
def annotate(path, identifier = nil)
identifier = 'HEAD' if identifier.blank?
cmd_args = %w[blame --encoding=UTF-8]
cmd_args << '-p' << identifier << '--' << scm_iconv(@path_encoding, 'UTF-8', path)
blame = Annotate.new
Method diff_with_options
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def diff_with_options
if params[:format] == 'diff'
@diff = @repository.diff @path, @rev, @rev_to, bypass_cache: true
return show_error_not_found unless @diff
Method entries
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def entries(path = nil, identifier = nil, **options)
path ||= ''
p = scm_iconv @path_encoding, 'UTF-8', path
entries = Entries.new
cmd_args = %w[ls-tree -l]
Method annotate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def annotate(path, identifier = nil)
identifier = 'HEAD' if identifier.blank?
cmd_args = %w[blame --encoding=UTF-8]
cmd_args << '-p' << identifier << '--' << scm_iconv(@path_encoding, 'UTF-8', path)
blame = Annotate.new
- 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 diff
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def diff(path, identifier_from, identifier_to = nil, **opts)
path ||= ''
cmd_args = []
if identifier_to
cmd_args << 'diff' << '--no-color' << identifier_to << identifier_from
- 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 check_xitolite_permissions
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def check_xitolite_permissions
case action_name
when 'index', 'show'
perm = "view_#{controller_name}".to_sym
render_403 unless User.current.git_allowed_to? perm, @repository
- 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 create_member
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def create_member(ids, current_ids, klass, destroy: true, inherited_by: nil, &block)
ids = (ids || []).collect(&:to_i) - [0]
new_ids = ids - current_ids
new_ids.each do |id|
object = klass.find_by id: id
- 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 sync_with_github
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
def sync_with_github
create_relation = false
## We don't have stored relation
if github_issue.nil?
Method git_config
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
def git_config
repo_conf = {}
# This is needed for all Redmine repositories
repo_conf['redminegitolite.projectid'] = project.identifier.to_s
Method temp_dir_writeable?
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def temp_dir_writeable?(reset: false)
@temp_dir_writeable = reset
unless @temp_dir_writeable
file_logger.debug "Testing if Gitolite Admin directory '#{create_temp_dir}' is writeable ..."
- 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 mirror_configuration
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def mirror_configuration
if mirror_mode?
reset_fields
elsif include_all_branches? && include_all_tags?
mutual_exclusion_error
- 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 branches
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def branches
return @branches if @branches
@branches = []
cmd_args = %w[branch --no-color --verbose --no-abbrev]
- 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 get_cache
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def get_cache(repo_id, command)
cached = GitCache.find_by repo_identifier: repo_id, command: command
if cached
if valid_cache_entry? cached.created_at
# Update updated_at flag
- 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 authorized_request?
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def authorized_request?
case git_cmd
when *RedmineGitHosting::GitAccess::DOWNLOAD_COMMANDS
if @user
RedmineGitHosting::GitAccess.new.download_access_check(@user, repository, ssl: is_ssl?).allowed?
- 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 sync_with_github
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
def sync_with_github
create_relation = false
## We don't have stored relation
if github_issue.nil?
- 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 git_config
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def git_config
repo_conf = {}
# This is needed for all Redmine repositories
repo_conf['redminegitolite.projectid'] = project.identifier.to_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 extract_payloads
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def extract_payloads
new_payloads = []
payloads.each do |payload|
data = RedmineGitHosting::Utils::Git.parse_refspec payload[:ref]
next unless data[:type] == 'heads' && post_receive_url.triggers.include?(data[: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"