Showing 75 of 126 total issues
Function buildURL
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
buildURL(baseUrl) {
var url = baseUrl;
for (var i = 1; i < arguments.length; i++) {
var args = arguments[i];
if (Array.isArray(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"
Further reading
Function vTimeout
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
nodeToReplace.vTimeout = setTimeout(function() {
httpRequest.onreadystatechange = function() {
if (httpRequest.readyState === XMLHttpRequest.DONE) {
console.debug(httpRequest.status + ':' +
this.getResponseHeader('content-type'));
Function displayErrors
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
displayErrors(result) {
const {statusCode, contentType, content} = result;
let responseErrors = null;
Function initialize
has 39 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function initialize(root, setRoot) {
console.debug('Initializing components');
const start = performance.now();
Function initEvents
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function initEvents(e) {
console.debug('\tEvents');
for (const eventElem of getEventElements(e)) {
var eventsData = JSON.parse(eventElem.dataset.events);
Function promiseObj
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
const promiseObj = new Promise(function(resolve) {
clearTimeout(elem.vTimeout);
elem.vTimeout = setTimeout(function() {
console.debug('Toggling visibility on: ' + targetId);
Function visibilityObserverMixin
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export let visibilityObserverMixin = Base => class extends Base {
recalcWhenVisible(vComponent) {
vComponent.hidden_on_create = vComponent.element.offsetParent === null;
if (vComponent.hidden_on_create) {
- 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 back
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
MaterialStepper.prototype.back = function () {
/** @type {boolean} */
var moved;
/** @type {function} */
var moveStep;
Function vTimeout
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
elem.vTimeout = setTimeout(function() {
console.debug('Toggling visibility on: ' + targetId);
if (action === 'show') {
if (elem.vComponent && elem.vComponent.show) {
Function onreadystatechange
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
httpRequest.onreadystatechange = function() {
if (httpRequest.readyState === XMLHttpRequest.DONE) {
console.debug(httpRequest.status + ':' +
this.getResponseHeader('content-type'));
if (httpRequest.status === 200) {
Function convertLists
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
function convertLists(richtext) {
const tempEl = window.document.createElement('div');
tempEl.setAttribute('style', 'display: none;');
tempEl.innerHTML = richtext;
Function getSteps_
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
MaterialStepper.prototype.getSteps_ = function () {
/** @type {array} */
var collection;
/** @type {number} */
var total;
Function inputs
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
inputs() {
const components = [];
// Collect tagged components, if applicable:
if (this.options.input_tag) {
- 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 setCustomEvents_
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
MaterialStepper.prototype.setCustomEvents_ = function () {
/** @type {function} */
var linearLabels;
/** @type {function} */
var nonLinearLabels;
Function call
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
call(results) {
return new Promise((resolve) => {
const elem = this.root.getElementById(this.elementId);
if (!elem) {
const err = new Error(
Function constructor
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
constructor(element, mdcComponent) {
super(element, mdcComponent);
const type = element.dataset.type;
const defaultConfig = {};
Method render_presenter
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
def render_presenter(presenter)
@grid_nesting = Integer(params[:grid_nesting] || 0)
begin
before_render = Presenters::Settings.config.presenters.before_render
Function inputs
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
inputs() {
const components = [];
// Collect tagged components, if applicable:
if (this.options.input_tag) {
Function serialize
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
serialize(obj, prefix) {
var str = [],
p;
for (p in obj) {
if (obj.hasOwnProperty(p)) {
- 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 previewComponent
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
previewComponent(e) {
if (!this.preview) return null;
for (const previewId of this.preview) {
const elem = this.root.querySelector(`#${previewId}`);
- 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"