Showing 1,179 of 1,179 total issues
Method parse_redmine_links
has a Cognitive Complexity of 225 (exceeds 5 allowed). Consider refactoring. Open
def parse_redmine_links(text, default_project, obj, attr, only_path, options)
text.gsub!(LINKS_RE) do |_|
tag_content = $~[:tag_content]
leading = $~[:leading]
esc = $~[:esc]
- 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
File issue.rb
has 1622 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Issue < ApplicationRecord
include Redmine::SafeAttributes
include Redmine::Utils::DateCalculation
include Redmine::I18n
before_save :set_parent_id
File application_helper.rb
has 1549 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'forwardable'
require 'cgi'
module ApplicationHelper
include Redmine::WikiFormatting::Macros::Definitions
File query.rb
has 1366 lines of code (exceeds 250 allowed). Consider refactoring. Open
class QueryColumn
attr_accessor :name, :totalable, :default_order
attr_writer :sortable, :groupable
include Redmine::I18n
Class Issue
has 152 methods (exceeds 20 allowed). Consider refactoring. Open
class Issue < ApplicationRecord
include Redmine::SafeAttributes
include Redmine::Utils::DateCalculation
include Redmine::I18n
before_save :set_parent_id
File application.js
has 1106 lines of code (exceeds 250 allowed). Consider refactoring. Open
/**
* Redmine - project management software
* Copyright (C) 2006- Jean-Philippe Lang
* This code is released under the GNU General Public License.
*/
File project.rb
has 1005 lines of code (exceeds 250 allowed). Consider refactoring. Open
class Project < ApplicationRecord
include Redmine::SafeAttributes
include Redmine::NestedSet::ProjectNestedSet
# Project statuses
Method show_detail
has a Cognitive Complexity of 119 (exceeds 5 allowed). Consider refactoring. Open
def show_detail(detail, no_html=false, options={})
multiple = false
show_diff = false
no_details = 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
File gantt.rb
has 947 lines of code (exceeds 250 allowed). Consider refactoring. Open
module Redmine
module Helpers
# Simple class to handle gantt chart data
class Gantt
class MaxLinesLimitReached < StandardError
Method replace_transitions
has a Cognitive Complexity of 109 (exceeds 5 allowed). Consider refactoring. Open
def self.replace_transitions(trackers, roles, transitions)
trackers = Array.wrap trackers
roles = Array.wrap roles
transaction do
- 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 issue_to_pdf
has a Cognitive Complexity of 106 (exceeds 5 allowed). Consider refactoring. Open
def issue_to_pdf(issue, assoc={})
pdf = ITCPDF.new(current_language)
pdf.set_title("#{issue.project} - #{issue.tracker} ##{issue.id}")
pdf.alias_nb_pages
pdf.footer_date = format_date(User.current.today)
- 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
File field_format.rb
has 872 lines of code (exceeds 250 allowed). Consider refactoring. Open
require 'uri'
module Redmine
module FieldFormat
def self.add(name, klass)
Class Query
has 106 methods (exceeds 20 allowed). Consider refactoring. Open
class Query < ApplicationRecord
class StatementInvalid < ::ActiveRecord::StatementInvalid
end
class QueryError < StandardError
Method parse_wiki_links
has a Cognitive Complexity of 93 (exceeds 5 allowed). Consider refactoring. Open
def parse_wiki_links(text, project, obj, attr, only_path, options)
text.gsub!(/(!)?(\[\[([^\n\|]+?)(\|([^\n\|]+?))?\]\])/) do |m|
link_project = project
esc, all, page, title = $1, $2, $3, $5
if esc.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
File redcloth3.rb
has 788 lines of code (exceeds 250 allowed). Consider refactoring. Open
class RedCloth3 < String
include Redmine::Helpers::URL
VERSION = '3.0.4'
DEFAULT_RULES = [:textile, :markdown]
File issue_query.rb
has 773 lines of code (exceeds 250 allowed). Consider refactoring. Open
class IssueQuery < Query
self.queried_class = Issue
self.view_permission = :view_issues
self.available_columns = [
Method prepare
has 355 lines of code (exceeds 25 allowed). Consider refactoring. Open
def self.prepare
ApplicationRecord.include Redmine::Acts::Positioned
ApplicationRecord.include Redmine::Acts::Mentionable
ApplicationRecord.include Redmine::I18n
Class User
has 92 methods (exceeds 20 allowed). Consider refactoring. Open
class User < Principal
include Redmine::Ciphering
include Redmine::SafeAttributes
# Different ways of displaying/sorting users
File user.rb
has 746 lines of code (exceeds 250 allowed). Consider refactoring. Open
require "digest/sha1"
class User < Principal
include Redmine::Ciphering
include Redmine::SafeAttributes
Method revisions
has a Cognitive Complexity of 83 (exceeds 5 allowed). Consider refactoring. Open
def revisions(path, identifier_from, identifier_to, options={})
revs = Revisions.new
cmd_args = %w|log --no-color --encoding=UTF-8 --raw --date=iso --pretty=fuller --parents --stdin|
cmd_args << '--no-renames' if self.class.client_version_above?([2, 9])
cmd_args << "--reverse" if options[:reverse]
- 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"