Showing 342 of 433 total issues
Class IssueTracker
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class IssueTracker < ApplicationRecord
has_many :issues, dependent: :destroy
class NotFoundError < APIError
setup 'issue_tracker_not_found', 404, 'Issue Tracker not found'
Class UsersController
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class Webui::UsersController < Webui::WebuiController
# TODO: Remove this when we'll refactor kerberos_auth
before_action :kerberos_auth, only: %i[index edit destroy update change_password edit_account]
before_action :authorize_user, only: %i[index edit destroy change_password edit_account]
before_action :require_admin, only: %i[index edit destroy]
Method project_index
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def project_index
prj = nil
prj = Project.get_by_name(params[:project]) unless params[:project] == '_dispatchprios'
if request.get?
Method parse_status
has 57 lines of code (exceeds 25 allowed). Consider refactoring. Open
def parse_status(project_name, package)
comments_to_clear = []
outs = []
sortkey = "9-ok-#{package['name']}"
age = age_from_devel(package['develmtime'].to_i)
Method copy_binaries
has a Cognitive Complexity of 20 (exceeds 8 allowed). Consider refactoring. Open
def copy_binaries(filter_source_repository, filter_architecture, source_package, target_package_name,
target_project, multibuild_container, setrelease, manual)
update_ids = []
source_package.project.repositories.each do |source_repo|
next if filter_source_repository && filter_source_repository != source_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 monitor_parse_result
has a Cognitive Complexity of 20 (exceeds 8 allowed). Consider refactoring. Open
def monitor_parse_result(result)
repo = result['repository']
arch = result['arch']
return unless @repo_filter.nil? || @repo_filter.include?(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 render_grouplist_ldap
has 56 lines of code (exceeds 25 allowed). Consider refactoring. Open
def render_grouplist_ldap(grouplist, user = nil)
result = []
@@ldap_search_con = initialize_ldap_con(CONFIG['ldap_search_user'], CONFIG['ldap_search_auth']) if @@ldap_search_con.nil?
ldap_con = @@ldap_search_con
if ldap_con.nil?
Method assignreview
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
def assignreview(opts = {})
raise InvalidStateError, 'request is not in review state' unless state == :review || state == :new
reviewer = User.find_by_login!(opts[:reviewer])
- 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 forward
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
def forward
forward_object = nil
target_package_object = Package.find_by_project_and_name(target_project, target_package)
if target_package_object
- 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 new_tracker
has a Cognitive Complexity of 19 (exceeds 8 allowed). Consider refactoring. Open
def new_tracker
# collection with all informations of the new issues
issue_collection = []
error = ''
invalid_format = ''
- 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
has 52 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create
# FIXME: We should use strong parameters instead of this custom implementation
params.fetch(:linked_project) { raise ArgumentError, 'Linked Project parameter missing' }
params.fetch(:linked_package) { raise ArgumentError, 'Linked Package parameter missing' }
Method cmd_changestate_permissions
has 51 lines of code (exceeds 25 allowed). Consider refactoring. Open
def cmd_changestate_permissions(opts)
# We do not support to revert changes from accepted requests (yet)
raise PostRequestNoPermission, 'change state from an accepted state is not allowed.' if req.state == :accepted
# need to check for accept permissions
Method search
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def search(what, render_all)
if render_all && params[:match].blank?
render_error status: 400, errorcode: 'empty_match',
message: 'No predicate found in match argument'
return
Method notifiable_link_text
has 50 lines of code (exceeds 25 allowed). Consider refactoring. Open
def notifiable_link_text
case @notification.event_type
when 'Event::RequestStatechange', 'Event::RequestCreate', 'Event::ReviewWanted'
"#{helpers.request_type_of_action(@notification.notifiable)} Request ##{@notification.notifiable.number}"
when 'Event::CommentForRequest'
Method image_params
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def image_params
preferences_attributes = %i[
id
type_image
type_containerconfig_name
Method show
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def show
# FIXME: Remove this statement when scmsync is fully supported
if @project.scmsync.present?
flash[:error] = "Package sources for project #{@project.name} are received through scmsync.
This is not yet fully supported by the OBS frontend"
Method notifiable_link_path
has 48 lines of code (exceeds 25 allowed). Consider refactoring. Open
def notifiable_link_path
case @notification.event_type
when 'Event::RequestStatechange', 'Event::RequestCreate', 'Event::ReviewWanted'
Rails.application.routes.url_helpers.request_show_path(@notification.notifiable.number, notification_id: @notification.id)
when 'Event::CommentForRequest'
Method extend_packages_to_link
has a Cognitive Complexity of 18 (exceeds 8 allowed). Consider refactoring. Open
def extend_packages_to_link(p)
return unless p[:package].is_a?(Package) # only for local packages
pkg = p[:package]
if pkg.is_link?
- 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_branch_project
has a Cognitive Complexity of 18 (exceeds 8 allowed). Consider refactoring. Open
def create_branch_project
if Project.exists_by_name(@target_project)
raise CreateProjectNoPermission, "The destination project already exists, so the api can't make it not readable" if @noaccess
tprj = Project.get_by_name(@target_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 build
has a Cognitive Complexity of 18 (exceeds 8 allowed). Consider refactoring. Open
def build
# the target is by default the _link target
# maintenance_release creates new packages instance, but are changing the source only according to the link
provided_in_other_action = check_for_local_linked_packages(source_package)
# fallback name as last resort
- 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"