Showing 75 of 126 total issues
Function expandParams
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function expandParams(results, params) {
const expandedParams = {};
for (const [key, value] of Object.entries(params)) {
if (!isObject(value) || value.type === 'action_parameter') {
- 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 initDragAndDrop
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function initDragAndDrop(root) {
const draggables = Array.from(root.querySelectorAll(DRAGGABLE_SELECTOR));
if (typeof root.matches === 'function' && root.matches(DRAGGABLE_SELECTOR)) {
draggables.unshift(root);
- 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 _table_row_
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def _table_row_(__columns__, block, except, item_, timezone: nil)
__columns__.each do |col|
next if except.include?(col.name.to_sym)
value = format_value(col.name,item_.send(col.name.to_sym), timezone: timezone)
column value 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 render
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def render
comp = ComponentDecoratorFactory.build(@comp)
components = @components.map { |c| ComponentDecoratorFactory.build(c) }
return public_send(:"render_#{@scope ? "_#{@scope}_" : nil}#{@comp.type}",
- 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 validate_padding
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def validate_padding(padding_)
valid_padding = %i(top right bottom left
top0 right0 bottom0 left0
top1 right1 bottom1 left1
top2 right2 bottom2 left2
- 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 fireAfterLoad
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
function fireAfterLoad(e) {
for (const eventElem of getEventElements(e)) {
var eventsData = JSON.parse(eventElem.dataset.events);
for (var j = 0; j < eventsData.length; j++) {
var eventData = eventsData[j];
- 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 optionSelected
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
optionSelected() {
const dataList = this.element.querySelector('datalist');
if (dataList) {
const parentElement = this.input;
// If we find the input inside our list, we submit the form
- 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 removeEvents
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function removeEvents(elem) {
console.debug('\tuninitEvents');
for (const eventElem of getEventElements(elem)) {
let eventsData = JSON.parse(eventElem.dataset.events);
- 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 getEventTarget
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function getEventTarget(event) {
if (typeof event.composedPath === 'function') {
const compTarget = event.composedPath()[0];
if (compTarget) {
- 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 helpers
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def helpers(module_=nil, &block)
return unless module_ || block
@helpers ||= Module.new
@helpers.include module_ if module_
@helpers.module_eval(&block) if block
- 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 validate
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
validate(form, params) {
console.debug('Form validate', form, params);
const errors = [];
- 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 global_namespace_css
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def global_namespace_css(path)
return unless custom_css_path && path
namespace_path = path.split('/').reject { |c| c.empty? }.first
css_file = File.join(custom_css_path, namespace_path ? namespace_path : '')
css_file = File.join(css_file, 'global.css')
- 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 render_presenter
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def render_presenter(presenter)
begin
before_render = Presenters::Settings.config.presenters.before_render
render_instead, ctx = before_render
.lazy
- 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 search
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def search(term)
require 'yaml'
return [] unless term
@terms ||= YAML::load_file(File.join(__dir__, './search-terms.yml'))
@terms.keys.reduce([]) do |matches, topic|
- 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 traverse
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
def self.traverse(hash, &block)
hash.inject({}) do |h,(k,v)|
if Hash === v
v = traverse(v,&block)
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"