Showing 261 of 342 total issues
Function ConflictedFieldDialogue
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.ConflictedFieldDialogue = (function($, S) {
var dom = S.Dom, Dialogue = Spontaneous.Dialogue;
var ConflictedFieldDialogue = new JS.Class(Dialogue, {
initialize: function(parent_view, conflicted_fields) {
- 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 Page
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
Spontaneous.Page = (function($, S) {
var dom = S.Dom, user = S.User;
var Page = new JS.Class(Spontaneous.Content, {
initialize: function(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
Avoid deeply nested control flow statements. Open
for (i = startPosition - 1; i > position; i--) {
targets.push(allTargets[i]);
}
Function _draw_square
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
_draw_square: function(ctx, c, r1, r2, a, p) {
Function _draw_rounded
has 6 arguments (exceeds 4 allowed). Consider refactoring. Open
_draw_rounded: function(ctx, c, r1, r2, a, p) {
Avoid deeply nested control flow statements. Open
elsif t == '"'
# Special case: single-character " token
if prev_token_last_char =~ /\S/
t = CLOSE_DBL_QUOTE
else
Method content_for_request
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def content_for_request(lock = false)
content_model.db.transaction do
dataset = lock ? content_model.for_update : content_model
content = dataset.get(params[:id])
halt 404 if content.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
Avoid deeply nested control flow statements. Open
if prev_token_last_char =~ /\S/
t = CLOSE_SGL_QUOTE
else
t = OPEN_SGL_QUOTE
end
Method create_ownership_modifications
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def create_ownership_modifications
change = changes_to_cascade[:visibility_path]
return false if change.nil?
old_value, new_value = change.old_value, change.new_value
return false if old_value.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 reload!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def reload!
rotation do |file, mtime|
# Retrive the last modified time
new_file = mtimes[file].nil?
previous_mtime = mtimes[file] ||= mtime
- 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 fix_schema
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def fix_schema(error)
modification = error.modification
actions = modification.actions
say(actions.description, :red)
say("Please choose one of the solutions below", :yellow)
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(owner, name, type, options={}, blocks = [], &block)
Method combine_shards
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def combine_shards(hashes, &block)
hashes = hashes.split(',') unless hashes.is_a?(Array)
shards = hashes.map { |hash| Spontaneous.shard_path(hash) }
Tempfile.open('shard') do |combined|
combined.binmode
- 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 field
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def field(name, type=nil, options={}, &block)
if type.is_a?(Hash)
options = type
type = nil
end
- 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 6 arguments (exceeds 4 allowed). Consider refactoring. Open
def initialize(owner, user, created_at, old_visibility_path, new_owner_id, new_box_sid)
Method reload!
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def reload!
changed_files = []
rotation do |file, mtime|
# Retrive the last modified time
new_file = mtimes[file].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
Function makeRequest
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
makeRequest: function(method, url, data, callback, options) {
Method define_proxy_association
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def define_proxy_association(association, proxy_methods, name, opts = {}, &block)
Method register
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def register(task_name, task, options = {}, params = {}, env = {})
Method store
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def store(revision, partition, path, template, transaction)