Showing 1,184 of 1,184 total issues
Method aggregate
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def aggregate(data, criteria)
a = 0
data.each do |row|
match = 1
criteria.each do |k, v|
- 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 diff
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def diff
if params[:format] == 'diff'
@diff = @repository.diff(@path, @rev, @rev_to)
(show_error_not_found; return) unless @diff
filename = +"changeset_r#{@rev}"
- 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 retrieve_previous_and_next_issue_ids
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def retrieve_previous_and_next_issue_ids
if params[:prev_issue_id].present? || params[:next_issue_id].present?
@prev_issue_id = params[:prev_issue_id].presence.try(:to_i)
@next_issue_id = params[:next_issue_id].presence.try(:to_i)
@issue_position = params[:issue_position].presence.try(:to_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 entries
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def entries(path="", identifier=nil, options={})
entries = Entries.new
trgt_utf8 = target(path)
trgt = scm_iconv(@path_encoding, 'UTF-8', trgt_utf8)
Dir.new(trgt).each do |e1|
- 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 entries
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def entries(path=nil, identifier=nil, options={})
path ||= ''
identifier = (identifier and identifier.to_i > 0) ? identifier.to_i : "HEAD"
entries = Entries.new
cmd = +"#{self.class.sq_bin} list --xml #{target(path)}@#{identifier}"
- 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 entries
has a Cognitive Complexity of 24 (exceeds 5 allowed). Consider refactoring. Open
def entries(path=nil, identifier=nil, options={})
path ||= ''
entries = Entries.new
identifier = -1 unless identifier && identifier.to_i > 0
cmd_args = %w|ls -v --show-ids|
- 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 drawRevisionGraph
has 84 lines of code (exceeds 25 allowed). Consider refactoring. Open
function drawRevisionGraph(holder, commits_hash, graph_space) {
var XSTEP = 20,
CIRCLE_INROW_OFFSET = 10;
var commits_by_scmid = commits_hash,
commits = $.map(commits_by_scmid, function(val,i){return val;});
Class WikiPage
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class WikiPage < ApplicationRecord
include Redmine::SafeAttributes
belongs_to :wiki
has_one :content, :class_name => 'WikiContent', :foreign_key => 'page_id',
Class AccountController
has 28 methods (exceeds 20 allowed). Consider refactoring. Open
class AccountController < ApplicationController
helper :custom_fields
include CustomFieldsHelper
self.main_menu = false
Method initialize
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
def initialize
self.issue_attributes = {}
optparse = OptionParser.new do |opts|
opts.banner = "Usage: rdm-mailhandler.rb [options] --url=<Redmine URL> --key=<API key>"
Method calc_col_width
has 83 lines of code (exceeds 25 allowed). Consider refactoring. Open
def calc_col_width(issues, query, table_width, pdf)
# calculate statistics
# by captions
pdf.SetFontStyle('B', 8)
margins = pdf.get_margins
Method receive
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def receive(email, options={})
@email = email
@handler_options = options
sender_email = email.from.to_a.first.to_s.strip
# Ignore emails received from the application emission address to avoid hell cycles
- 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 details_to_strings
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def details_to_strings(details, no_html=false, options={})
options[:only_path] = !(options[:only_path] == false)
strings = []
values_by_field = {}
details.each do |detail|
- 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
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def update
return unless update_issue_from_params
attachments = params[:attachments] || params.dig(:issue, :uploads)
if @issue.attachments_addable?
- 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 retrieve_query
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def retrieve_query(klass=IssueQuery, use_session=true, options={})
session_key = klass.name.underscore.to_sym
if params[:query_id].present?
scope = klass.where(:project_id => 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
Method inline_textile_link
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def inline_textile_link( text )
text.gsub!( LINK_RE ) do |m|
all,pre,atts,text,title,url,proto,slash,post = $~[1..9]
if text.include?('<br />')
all
- 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_html
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def to_html
words = self.words.collect{|word| h(word)}
words_add = 0
words_del = 0
dels = 0
- 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 lcs
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def Diff.lcs(a, b)
astart = 0
bstart = 0
afinish = a.length-1
bfinish = b.length-1
- 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 check
has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring. Open
def check(imap_options={}, options={})
host = imap_options[:host] || '127.0.0.1'
port = imap_options[:port] || '143'
ssl = !imap_options[:ssl].nil?
starttls = !imap_options[:starttls].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
Method copy_issues
has 80 lines of code (exceeds 25 allowed). Consider refactoring. Open
def copy_issues(project)
# Stores the source issue id as a key and the copied issues as the
# value. Used to map the two together for issue relations.
issues_map = {}