Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Ignore Metrics/AbcSize cop

Alexander Brandon Coles3c37eef9c9dd
diff --git a/lib/open_project/text_formatting/filters/macro_filter.rb b/lib/open_project/text_formatting/filters/macro_filter.rb
index 3bb328145ff..8f2699efd01 100644
--- a/lib/open_project/text_formatting/filters/macro_filter.rb
+++ b/lib/open_project/text_formatting/filters/macro_filter.rb
@@ -39,7 +39,7 @@ module OpenProject::TextFormatting
macros.each { |macro| registered << macro }
end
- def call
+ def call # rubocop:disable Metrics/AbcSize
doc.search("macro").each do |macro|
registered.each do |macro_class|
next unless macro_applies?(macro_class, macro)
diff --git a/lib/open_project/text_formatting/filters/macros/create_work_package_link.rb b/lib/open_project/text_formatting/filters/macros/create_work_package_link.rb
index c862e0a6c81..5e3aae66d08 100644
--- a/lib/open_project/text_formatting/filters/macros/create_work_package_link.rb
+++ b/lib/open_project/text_formatting/filters/macros/create_work_package_link.rb
@@ -46,7 +46,7 @@ module OpenProject::TextFormatting::Filters::Macros
macro.replace work_package_link(macro, context)
end
- def work_package_link(macro, context)
+ def work_package_link(macro, context) # rubocop:disable Metrics/AbcSize
project = context[:project]
raise I18n.t("macros.create_work_package_link.errors.no_project_context") if project.nil?
diff --git a/lib/open_project/text_formatting/filters/table_of_contents_filter.rb b/lib/open_project/text_formatting/filters/table_of_contents_filter.rb
index 3b53636bc47..0516d492b51 100644
--- a/lib/open_project/text_formatting/filters/table_of_contents_filter.rb
+++ b/lib/open_project/text_formatting/filters/table_of_contents_filter.rb
@@ -82,7 +82,7 @@ module OpenProject::TextFormatting
parent_number == "" ? num_in_level.to_s : "#{parent_number}.#{num_in_level}"
end
- def render_nested(level = 0, parent_number = "")
+ def render_nested(level = 0, parent_number = "") # rubocop:disable Metrics/AbcSize
result = "".html_safe
num_in_level = 0
diff --git a/lib/open_project/text_formatting/filters/task_list_filter.rb b/lib/open_project/text_formatting/filters/task_list_filter.rb
index f18480ab7f2..466eec86d6a 100644
--- a/lib/open_project/text_formatting/filters/task_list_filter.rb
+++ b/lib/open_project/text_formatting/filters/task_list_filter.rb
@@ -58,7 +58,7 @@ module OpenProject::TextFormatting
# Modifications apply to the parsed document directly.
#
# Returns nothing.
- def filter!
+ def filter! # rubocop:disable Metrics/AbcSize
list_items(doc).reverse_each do |li|
next if list_items(li.parent).empty?
diff --git a/lib/open_project/text_formatting/matchers/link_handlers/colon_separator.rb b/lib/open_project/text_formatting/matchers/link_handlers/colon_separator.rb
index 30616eec585..dbcff4b004b 100644
--- a/lib/open_project/text_formatting/matchers/link_handlers/colon_separator.rb
+++ b/lib/open_project/text_formatting/matchers/link_handlers/colon_separator.rb
@@ -89,7 +89,7 @@ module OpenProject::TextFormatting::Matchers
end
end
- def render_commit
+ def render_commit # rubocop:disable Metrics/AbcSize
if project&.repository &&
(changeset = Changeset.where(["repository_id = ? AND scmid LIKE ?", project.repository.id, "#{oid}%"]).first)
link_to h("#{matcher.project_prefix}#{matcher.identifier}"),
@@ -100,7 +100,7 @@ module OpenProject::TextFormatting::Matchers
end
end
- def render_source
+ def render_source # rubocop:disable Metrics/AbcSize
if project&.repository
matcher.identifier =~ %r{\A[/\\]*(.*?)(@([0-9a-f]+))?(#(L\d+))?\z}
path = $1
diff --git a/lib/open_project/text_formatting/matchers/link_handlers/revisions.rb b/lib/open_project/text_formatting/matchers/link_handlers/revisions.rb
index 8148c6e74c4..d031c94f1b6 100644
--- a/lib/open_project/text_formatting/matchers/link_handlers/revisions.rb
+++ b/lib/open_project/text_formatting/matchers/link_handlers/revisions.rb
@@ -43,7 +43,7 @@ module OpenProject::TextFormatting::Matchers
# Examples:
#
# r11, r13
- def call
+ def call # rubocop:disable Metrics/AbcSize
# don't handle link unless repository exists
return nil unless project&.repository
diff --git a/lib/open_project/text_formatting/matchers/wiki_links_matcher.rb b/lib/open_project/text_formatting/matchers/wiki_links_matcher.rb
index 799e2594a18..e90484c4b57 100644
--- a/lib/open_project/text_formatting/matchers/wiki_links_matcher.rb
+++ b/lib/open_project/text_formatting/matchers/wiki_links_matcher.rb
@@ -116,7 +116,7 @@ module OpenProject::TextFormatting
link_from_match
end
- def link_from_match
+ def link_from_match # rubocop:disable Metrics/AbcSize
# extract anchor
anchor = nil
if page =~ /\A(.+?)\#(.+)\z/