Showing 36 of 58 total issues
Function renderer
has 7 arguments (exceeds 4 allowed). Consider refactoring. Open
c.renderer = function(value, a, r, ri, ci, store, view){
Function initComponent
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
initComponent: function(){
if (!this.type || this.assoc) this.type = 'string';
this.typeHash = {};
- 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 netzkeSetReadonlyMode
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
netzkeSetReadonlyMode: function(onOff){
if (this.hidden) return;
if (!this.initialConfig.readOnly) {
this.setReadOnly(onOff);
- 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 extend_item
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def extend_item(item)
item = super
item_id = item[:netzke_component] || item[:item_id] # identify regions by item_id
if item_id
- 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 assoc.macro == :has_one
assoc_instance = record.send(assoc.name)
if assoc_instance
assoc_instance.send("#{assoc_method}=", value)
assoc_instance.save # what should we do when this fails?..
Method validate_config
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def validate_config(c)
raise ArgumentError, "Grid requires a model" if model.nil?
c.editing = :in_form if c.editing.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 netzkeOnItemContextMenu
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
netzkeOnItemContextMenu: function(grid, record, item, rowIndex, e){
Method set_defaults
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def set_defaults
super
self.type ||= @model_adapter.attr_type(name)
- 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 netzkeSetActionEvents
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
netzkeSetActionEvents: function(){
this.getSelectionModel().on('selectionchange', function(selModel, selected){
if (this.actions.delete) this.actions.delete.setDisabled(selected.length == 0);
if (this.actions.edit) {
- 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 create_or_update_record
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def create_or_update_record(hsh)
hsh.merge!(config[:strong_values]) if config[:strong_values]
# only pick the record specified in the params if it was not provided in the configuration
@record ||= model_adapter.find_record hsh.delete(model.primary_key.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 predicates_for_and_conditions
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def predicates_for_and_conditions(conditions)
return nil if conditions.empty?
predicates = conditions.map do |q|
q = HashWithIndifferentAccess.new(Netzke::Support.permit_hash_params(q))
- 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 build_action_config
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def build_action_config(a)
a = {name: a} if a.is_a?(Symbol)
a[:handler] ||= a[:name]
a.tap do |a|
a[:tooltip] ||= a[:name].to_s.humanize
- 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_record
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def update_record(record, attrs)
attrs.each_pair do |k,v|
attr = final_columns_hash[k.to_sym]
next if attr.nil?
model_adapter.set_record_value_for_attribute(record, attr, 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 destroy
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def destroy(ids)
out = {}
ids.each {|id|
record = model_adapter.find_record(id, scope: config[:scope])
- 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 initial_columns_order
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def initial_columns_order
non_meta_columns.map do |c|
# copy the values that are not null
{name: c[:name]}.tap do |r|
r[:width] = c[:width] if c[:width]
- 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 netzkeNormalizeRenderer
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
netzkeNormalizeRenderer: function(c) {
if (!c.renderer) return;
var name, args = [];
- 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"