Showing 385 of 423 total issues
Method create_expand_package
has a Cognitive Complexity of 170 (exceeds 8 allowed). Consider refactoring. Open
def create_expand_package(packages, opts = {})
newactions = []
incident_suffix = ''
# The maintenance ID is always the sub project name of the maintenance 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
Class Project
has 123 methods (exceeds 20 allowed). Consider refactoring. Open
class Project < ApplicationRecord
include FlagHelper
include Flag::Validations
include CanRenderModel
include HasRelationships
Class Package
has 119 methods (exceeds 20 allowed). Consider refactoring. Open
class Package < ApplicationRecord
include FlagHelper
include Flag::Validations
include CanRenderModel
include HasRelationships
Class User
has 91 methods (exceeds 20 allowed). Consider refactoring. Open
class User < ApplicationRecord
include CanRenderModel
include Flipper::Identifier
# Keep in sync with states defined in db/schema.rb
Class SourceController
has 79 methods (exceeds 20 allowed). Consider refactoring. Open
class SourceController < ApplicationController
include Source::Errors
validate_action index: { method: :get, response: :directory }
validate_action projectlist: { method: :get, response: :directory }
Class BsRequest
has 74 methods (exceeds 20 allowed). Consider refactoring. Open
class BsRequest < ApplicationRecord
include BsRequest::Errors
SEARCHABLE_FIELDS = [
'bs_requests.creator',
'bs_requests.priority',
Method create_branch_packages
has a Cognitive Complexity of 63 (exceeds 8 allowed). Consider refactoring. Open
def create_branch_packages(tprj)
# collect also the needed repositories here
response = nil
@packages.each do |p|
pac = p[:package]
- 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 initialize
has 228 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
@lexer = REXML::Parsers::XPathParser.new
@tables = {
'attribute' => 'attribs',
Method update_binary_releases_via_json
has a Cognitive Complexity of 60 (exceeds 8 allowed). Consider refactoring. Open
def self.update_binary_releases_via_json(repository, json, time = Time.now)
oldlist = where(repository: repository, obsolete_time: nil, modify_time: nil)
# we can not just remove it from relation, delete would affect the object.
processed_item = {}
- 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 action_details
has a Cognitive Complexity of 55 (exceeds 8 allowed). Consider refactoring. Open
def action_details(opts = {}, xml:)
with_diff = opts.delete(:diffs)
action = { type: xml.action_type }
action[:id] = xml.id
action[:number] = xml.bs_request.number
- 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 cmd_changestate_permissions
has a Cognitive Complexity of 51 (exceeds 8 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
- 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 BsRequestAction
has 52 methods (exceeds 20 allowed). Consider refactoring. Open
class BsRequestAction < ApplicationRecord
#### Includes and extends
include ParsePackageDiff
include BsRequestAction::Errors
#### Constants
Class PackageController
has 51 methods (exceeds 20 allowed). Consider refactoring. Open
class Webui::PackageController < Webui::WebuiController
include ParsePackageDiff
include Webui::PackageHelper
include Webui::ManageRelationships
include BuildLogSupport
Method check_action_permission!
has a Cognitive Complexity of 48 (exceeds 8 allowed). Consider refactoring. Open
def check_action_permission!(skip_source = nil)
# find objects if specified or report error
role = nil
sprj = nil
if person_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 determine_details_about_package_to_branch
has a Cognitive Complexity of 46 (exceeds 8 allowed). Consider refactoring. Open
def determine_details_about_package_to_branch(p)
return unless p[:link_target_project].is_a?(Project) # only for local source projects
check_for_update_project(p) unless params[:ignoredevel]
- 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_expand_package
has 161 lines of code (exceeds 25 allowed). Consider refactoring. Open
def create_expand_package(packages, opts = {})
newactions = []
incident_suffix = ''
# The maintenance ID is always the sub project name of the maintenance project
Method branch_local_repositories
has a Cognitive Complexity of 45 (exceeds 8 allowed). Consider refactoring. Open
def branch_local_repositories(project, pkg_to_enable, opts = {})
# shall we use the repositories from a different project?
project = project.update_instance('OBS', 'BranchRepositoriesFromProject')
skip_repos = []
a = project.find_attribute('OBS', 'BranchSkipRepositories')
- 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 Base
has 46 methods (exceeds 20 allowed). Consider refactoring. Open
class Base < ApplicationRecord
self.inheritance_column = 'eventtype'
self.table_name = 'events'
after_create :create_project_log_entry_job, if: -> { (PROJECT_CLASSES | PACKAGE_CLASSES).include?(self.class.name) }
Method project_index
has a Cognitive Complexity of 44 (exceeds 8 allowed). Consider refactoring. Open
def project_index
prj = nil
prj = Project.get_by_name(params[:project]) unless params[:project] == '_dispatchprios'
if request.get?
- 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 ProjectController
has 43 methods (exceeds 20 allowed). Consider refactoring. Open
class Webui::ProjectController < Webui::WebuiController
include Webui::RequestHelper
include Webui::ProjectHelper
include Webui::ManageRelationships