Showing 75 of 126 total issues
Method presenters_path
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
def presenters_path(presenter, host: false, **params)
presenter = _expand_namespace_(presenter, namespace)
presenter = presenter.gsub(':', '/')
path = host ? voom_presenters_web_client_app_url(params, host: router.base_url) :
- 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 setActive_
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
MaterialStepper.prototype.setActive_ = function (id) {
/** @type {HTMLElement | null} */
var active;
/** MaterialStepper.Steps_.collection<step> */
var first;
Function call
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
call(results) {
const targetId = this.targetId;
const action = this.params.action;
const delayAmt = this.event instanceof FocusEvent ? 500 : 0;
const elem = this.root.getElementById(targetId);
Avoid deeply nested control flow statements. Open
if (moved && this.Stepper_.hasFeedback) {
// Remove the (feedback) transient effect before move
this.removeTransientEffect_(step);
}
Avoid deeply nested control flow statements. Open
if (!this.displayInputError(key, errors[key])) {
// If not handled at the field level, display at the page level
if (errors[key].length > 0) {
this.prependErrors([errors[key]]);
}
Avoid deeply nested control flow statements. Open
if (step.labelTitleMessageText) {
this.updateTitleMessage_(step, step.labelTitleMessageText);
} else {
this.removeTitleMessage_(step);
}
Avoid deeply nested control flow statements. Open
for (item in this.Steps_.collection) {
// Rule eslint guard-for-in.
if (this.Steps_.collection.hasOwnProperty(item)) {
stepItem = this.Steps_.collection[item];
Method initialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(**attribs_, &block)
super(type: :line, **attribs_, &block)
@selected = attribs.delete(:selected) {false}
@selectable = attribs.delete(:selectable) {false}
self.text(attribs.delete(:text), attribs) if attribs[:text]
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
def initialize(**attribs_, &block)
super(type: :dialog, **attribs_, &block)
width = attribs.delete(:width)
height = attribs.delete(:height)
@percent_width = width&.end_with?("%") ? width : 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 (previous.isEditable) {
moved = moveStep.bind(this)(previous);
}
Avoid deeply nested control flow statements. Open
if (step.isOptional || step.id === this.Steps_.total) {
this.updateStepState_(step, this.StepState_.COMPLETED);
}
Function getData
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
getData(funcProcessData) {
let comp = this.component();
console.log(comp);
if(comp.value().length < 2){
return;
- 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 select
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
def select(options, current_option, total_records, replace_id = @replace_id, replace_presenter = @replace_presenter)
Method initialize
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def initialize(type: nil, **attribs_, &block)
@button_type = type || ((attribs_[:icon] && !attribs_[:text]) ? :icon : nil) || :flat
super(type: :button, **attribs_, &block)
@color = attribs.delete(:color)
@background_color = attribs.delete(:background_color)
- 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 constructor
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
constructor(element) {
super(element);
const pluginClassName = this.element.dataset.pluginCallback;
if (pluginClassName) {
var PluginClass = null;
- 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 flatten
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
flatten(errors) {
if (!errors) {
return [];
}
- 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 checkValue
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
function checkValue(str, max) {
if (str.charAt(0) !== '0' || str === '00') {
let num = parseInt(str);
if (isNaN(num) || num <= 0 || num > max) num = 1;
str = num > parseInt(max.toString().charAt(0)) && num.toString().length === 1 ? '0' + num : num.toString();
- 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 isValidDate
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
isValidDate(dateString) {
dateString = dateString.replace(/\s+/g, '');
if (dateString === '' && !this.input.required) {
return true
}
- 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 color_classname
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def color_classname(comp, affects = nil, color_attr = :color)
color = comp&.public_send(color_attr)
return unless color
return "v-#{comp.type}__primary" if eq(color, :primary)
- 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_render_url
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
def build_render_url(render_, params, host:)
return '#' unless render_
render = render_.to_s
return render if render.start_with?('http')
render = render.gsub(':', '/')
- 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"