Showing 75 of 126 total issues
File mdl-stepper.js
has 596 lines of code (exceeds 250 allowed). Consider refactoring. Open
/*
This file was copied from the MDL Stepper Polyfill at https://ahlechandre.github.io/mdl-stepper/component/
The stepper looks and behaves failry well but we wanted some specific behavior changes so pulled in a copy here.
*/
Function call
has 130 lines of code (exceeds 25 allowed). Consider refactoring. Open
call(results, eventParams) {
this.clearErrors();
let method = this.method;
const ev = new CustomEvent('V:postStarted', {
Function displayErrors
has a Cognitive Complexity of 33 (exceeds 5 allowed). Consider refactoring. Open
displayErrors(result) {
const {statusCode, contentType, content} = result;
let responseErrors = 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 call
has a Cognitive Complexity of 28 (exceeds 5 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);
- 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_hash
has a Cognitive Complexity of 22 (exceeds 5 allowed). Consider refactoring. Open
def build_hash
accessable = instance_variables.map {|i| i.to_s.gsub('@', '').to_sym} & methods
accessable.reduce({}) do |hash, v|
trace {"#{v}:#{params.inspect}"}
params = Parameters.new(method(v).parameters)
- 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 call
has 77 lines of code (exceeds 25 allowed). Consider refactoring. Open
call() {
const event = this.event;
const target = getEventTarget(event);
let eventParams = {};
Function initEvents
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
export function initEvents(e) {
console.debug('\tEvents');
for (const eventElem of getEventElements(e)) {
var 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 call
has a Cognitive Complexity of 21 (exceeds 5 allowed). Consider refactoring. Open
call(results, eventParams) {
this.clearErrors();
let method = this.method;
const ev = new CustomEvent('V:postStarted', {
- 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 call
has 72 lines of code (exceeds 25 allowed). Consider refactoring. Open
call(results, eventParams=[]) {
this.clearErrors();
const httpRequest = new XMLHttpRequest();
const root = this.root;
Class Event
has 24 methods (exceeds 20 allowed). Consider refactoring. Open
class Event < Base
attr_accessor :event, :actions
# Alias common event names
EVENT_MAP = {focus: :focusin, blur: :focusout, onload: :after_init}
Function updateStepState_
has 64 lines of code (exceeds 25 allowed). Consider refactoring. Open
MaterialStepper.prototype.updateStepState_ = function (step, state) {
/** @type {string} */
var stateClass;
/** @type {HTMLElement} */
var indicatorContent;
Class App
has 22 methods (exceeds 20 allowed). Consider refactoring. Open
class App < Sinatra::Base
include Trace
set :root, File.expand_path('../../../../..', __FILE__)
set :router_, WebClient::Router
set :bind, '0.0.0.0'
Function initLists
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
export function initLists(e) {
console.debug('\tLists');
let components = e.querySelectorAll('.mdc-list');
if (components.length === 0 && e.offsetParent && e.offsetParent.vComponent !== undefined) {
- 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 call
has 56 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);
Class UserInterface
has 21 methods (exceeds 20 allowed). Consider refactoring. Open
class UserInterface
include DSL::Definer
include DSL::ProtectFromForgery
include Components::Mixins::Common
include Components::Mixins::Helpers
Method expand_hash
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
def expand_hash(h)
HashExt::Traverse.traverse(h.to_h) do |k,v|
if !v.is_a?(Array) && v.respond_to?(:to_h)
v = v.is_a?(OpenStruct) ? expand_hash(v.to_h) : v.to_h
elsif v.is_a?(Array)
- 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 next
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
MaterialStepper.prototype.next = function () {
/** @type {boolean} */
var moved;
/** @type {MaterialStepper.Steps_.collection<step>} */
var step;
Function onreadystatechange
has 44 lines of code (exceeds 25 allowed). Consider refactoring. Open
httpRequest.onreadystatechange = (event) => {
if (httpRequest.readyState === XMLHttpRequest.DONE) {
const contentType = httpRequest.getResponseHeader('content-type');
console.debug(httpRequest.status + ':' + contentType);
Function action_class
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
static action_class(action, event, root) {
const action_type = action[0];
const url = action[1];
const options = action[2];
const params = action[3];
Function getStepModel_
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
MaterialStepper.prototype.getStepModel_ = function (step, id) {
/** @type {Object} */
var model;
/** @type {string} */
var selectorActionsBack;