Showing 12 of 90 total issues
File password.spec.js
has 371 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as helpers from "../utils/helpers.js"
import * as placekeeper from "../../src/main.js"
import * as polyfill from "../../src/polyfill.js"
describe("password inputs", () => {
Function checkForPlaceholder
has a Cognitive Complexity of 32 (exceeds 5 allowed). Consider refactoring. Open
function checkForPlaceholder(element) {
if (!element) {
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 triggerKeyboardEvent
has 94 lines of code (exceeds 25 allowed). Consider refactoring. Open
function triggerKeyboardEvent(target, type, keyCode) {
var evt;
// Don't do events on text and comment nodes
if (target.nodeType === 3 || target.nodeType === 8) {
File hide-on-input.spec.js
has 285 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as helpers from "../utils/helpers.js"
import * as placekeeper from "../../src/main.js"
import * as polyfill from "../../src/polyfill.js"
import * as utils from "../../src/utils.js"
import * as events from "../../src/events.js"
File public.spec.js
has 267 lines of code (exceeds 250 allowed). Consider refactoring. Open
import * as helpers from "../utils/helpers.js"
import * as placekeeper from "../../src/main.js"
import * as utils from "../../src/utils.js"
import * as events from "../../src/events.js"
import * as support from "../../src/support.js"
Function checkForPlaceholder
has 47 lines of code (exceeds 25 allowed). Consider refactoring. Open
function checkForPlaceholder(element) {
if (!element) {
return
}
Function _initKeyboardEvent_type
has 43 lines of code (exceeds 25 allowed). Consider refactoring. Open
var _initKeyboardEvent_type = (function() {
try {
var e = document.createEvent("KeyboardEvent");
e.initKeyboardEvent(
Function exports
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
"use strict";
var customLaunchers = {
// iOSSafari: {
Function exports
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = function(config) {
"use strict";
config.set(extend(shared, {
preprocessors: {
Function buildAdapter
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
function buildAdapter(adapter) {
return gulp.src([
"src/adapters/module." + adapter + ".js"
])
.pipe(rollup({
Function setup
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function setup() {
if (!support.hasNativePlaceholderSupport()) {
$.fn.val = function(val) {
const originalValue = originalValFn.apply(this, arguments)
- 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 showPlaceholder
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
export function showPlaceholder(element) {
const val = data.getValueAttr(element)
if (element.value !== "" || val == null) {
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"