File index.js
has 406 lines of code (exceeds 250 allowed). Consider refactoring. Open
import path from 'path';
import get from 'platform/utilities/data/get';
import disableFTUXModals from 'platform/user/tests/disableFTUXModals';
Function enterData
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
function enterData(field) {
switch (field.type) {
// Select fields register as having type 'select-one'.
case 'select-one':
cy.wrap(field.element)
Function testForm
has 73 lines of code (exceeds 25 allowed). Consider refactoring. Open
const testForm = testConfig => {
const {
appName,
arrayPages = [],
dataPrefix,
Function enterData
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function enterData(field) {
switch (field.type) {
// Select fields register as having type 'select-one'.
case 'select-one':
cy.wrap(field.element)
- 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 fillAvailableFields
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
const fillAvailableFields = () => {
getFieldSelectors().then(fieldSelector => {
cy.get(APP_SELECTOR, NO_LOG_OPTION)
.then($form => {
// Get the starting number of array items and fields to compare
Function addNewArrayItem
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
const addNewArrayItem = $form => {
// Get all array types on the current page.
const arrayTypeRoots = $form.find('div[name^="topOfTable_root_"]');
// Find the last entry for each array type, use its index to figure out
Function testForm
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
const testForm = testConfig => {
const {
appName,
arrayPages = [],
dataPrefix,
- 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 defaultPostHook
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring. Open
const defaultPostHook = pathname => {
// On review pages, check the privacy agreement box if it exists and submit.
if (pathname.endsWith('/review-and-submit')) {
return () => {
cy.get(APP_SELECTOR, NO_LOG_OPTION).then($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"