Showing 1,636 of 1,650 total issues
Method parse_id
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_id(resource_link,
property:,
expected_version: nil,
expected_namespace: nil)
raise ArgumentError unless resource_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 search_entries
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def search_entries(parts, identifier)
search_path = parts[0..-2].join("/")
search_name = parts[-1]
if search_path.blank? && search_name.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 write_offsets
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def write_offsets
if @added > 0 && @added == @removed
@added.times do |i|
line = self[-(1 + i)]
removed = @type == "sbs" ? line : self[-(1 + @added + i)]
- 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 call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.call(node, doc:, context:)
content = node.to_html
return unless applicable?(content)
# Replace the content
- 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 rollback_attachment
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def rollback_attachment(attachment)
return unless attachment.file.path
old_file = rolled_back_file_name attachment
- 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 parse_context
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def parse_context
context = ::API::Utilities::ResourceLinkParser.parse(params[:context])
if context.nil?
fail ::API::Errors::InvalidRenderContext.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 existing_rate_attributes=
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def existing_rate_attributes=(rate_attributes)
rates.reject(&:new_record?).each do |rate|
attributes = rate_attributes[rate.id.to_s]
has_rate = false
- 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 ifc_attachment_is_ifc
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def ifc_attachment_is_ifc
return unless model.ifc_attachment&.new_record? || model.ifc_attachment&.pending_direct_upload?
file_path = model.ifc_attachment.file.local_file.path
- 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 searchable_column_conditions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def searchable_column_conditions
searchable_options[:columns].map do |column|
name, scope = column.is_a?(Hash) ? column.values_at(:name, :scope) : column
match_condition = "(#{Arel.sql(name)} ILIKE ?)"
- 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
Function drop
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
async drop(el:Element, _target:Element|null, _source:Element|null, _sibling:Element|null) {
const id = el.getAttribute('data-id');
const url = el.getAttribute('data-drop-url');
const data = new FormData();
const newIndex = Array.from(this.containerTarget.children).indexOf(el);
- 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 to_ar_name
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def to_ar_name(attribute, context:, refer_to_ids: false, collapse_cf_name: true)
attribute = underscore_attribute attribute.to_s.underscore
attribute = collapse_custom_field_name(attribute) if collapse_cf_name
special_conversion = Constants::ARToAPIConversions.api_to_ar_conversions[attribute]
- 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
Function triggerLimitWarningIfReached
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
triggerLimitWarningIfReached(evt:CustomEvent) {
this.selectedValues = evt.detail as IUserAutocompleteItem[];
if (this.hasLimitWarningTarget && this.hasOpenSeatsValue) {
if (this.numberOfNewUsers > 0 && this.numberOfNewUsers > this.openSeatsValue) {
- 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_options
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def render_options(group_by_ary)
group_by_ary.sort_by(&:label).map do |group_by|
next unless group_by.selectable?
label_text = CGI::escapeHTML(h(group_by.label)).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 update_demo_xkt_models
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_demo_xkt_models
project = Project.find_by(identifier: "demo-bcf-management-project")
return unless project
ifc_models = project.ifc_models.joins(:attachments)
- 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 recognize_route
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.recognize_route(path)
return nil unless path.present?
# Remove relative URL root
if (relative_url = OpenProject::Configuration.rails_relative_url_root)
- 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 code_block_transformer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def code_block_transformer
lambda { |env|
name = env[:node_name]
code = env[:node]
- 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 icons
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def icons(result)
icons = ""
with_project(result.fields["project_id"]) do
if entry_for(result).editable_by? User.current
if controller_for(result.fields["type"]) == "costlog"
- 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
Function state
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
get state() {
if (this.mergeRequest.state === 'opened') {
return (this.mergeRequest.draft ? 'open' : 'ready');
} 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 view_permissions?
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def view_permissions?
return false unless user_allowed_on_view?(:view_ifc_models)
return false unless user_allowed_on_view?(:save_bcf_queries)
if model.query.public && !user_allowed_on_view?(:manage_public_bcf_queries)
return false
- 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 call
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def call
return html unless applicable?
html.gsub(self.class.regexp) do |matched_string|
variable = ($1.presence || $2.presence).dup
- 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"