Showing 132 of 502 total issues
File Location.jsx
has 767 lines of code (exceeds 750 allowed). Consider refactoring. Open
import React from 'react'
import { updateApplication } from 'actions/ApplicationActions'
import { i18n, env } from 'config'
import { LocationValidator } from 'validators'
Function render
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
requireForeignCounterIntelligence,
requireForeignExcessiveKnowledge,
requireForeignSensitiveInformation,
- 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 render
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
render() {
const {
HomeEmail = {}, WorkEmail = {}, isReview, errors,
} = this.props
const klass = `${this.props.className || ''}`.trim()
- 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 render
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
render() {
const instateZipcode = this.zipcodeInstate()
const domesticFields = this.props.domesticFields.map((field) => {
const key = `domestic-${field}`
- 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 branchCollectionValidator
has a Cognitive Complexity of 17 (exceeds 5 allowed). Consider refactoring. Open
const branchCollectionValidator = (value, options, key, attributes, globalOptions) => {
if (value === undefined) return null // Only validate if there's a value
if (value === null) return MISSING_ITEMS
const { items } = value
- 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 triageErrors
has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring. Open
export const triageErrors = (section, previous, codes) => {
let arr = []
// First we need to persist any error messages stored in the same section
// but not necessarily within the same scope
- 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 16 (exceeds 5 allowed). Consider refactoring. Open
constructor(data = {}, context = null) {
this.month = data.month
this.day = data.day
this.year = data.year
this.hideMonth = data.hideMonth
- 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 unschema
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const unschema = (data) => {
if (data === undefined || data === null) {
return 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 connectSubsection
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
const connectSubsection = (Component, {
key, section, subsection, store,
}) => {
class ConnectedSubsection extends React.Component {
constructor(props) {
- 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 CitizenshipStatus.Unmarshal
has 27 return statements (exceeds 10 allowed). Open
func (entity *CitizenshipStatus) Unmarshal(raw []byte) error {
err := json.Unmarshal(raw, entity)
if err != nil {
return err
}
Function calculateTime
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
calculateTime() {
const { elapsed } = this.state
// If there has been no time elapsed...
if (!elapsed) {
- 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 validFields
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
validFields(fields) {
if (!fields || !fields.length) {
return false
}
- 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 DateSummary
has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring. Open
export const DateSummary = (
props,
unknown = i18n.t('history.employment.default.noDate.label'),
full = false
) => {
- 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 render
has 275 lines of code (exceeds 255 allowed). Consider refactoring. Open
render() {
const { requireRelationshipMaritalDivorcePhoneNumber } = this.props
const enteredCivilUnionMinDate = pickDate([this.props.applicantBirthdate, this.props.Birthdate])
return (
<div className="divorce">
Method Location.Valid
has a Cognitive Complexity of 29 (exceeds 20 allowed). Consider refactoring. Open
func (entity *Location) Valid() (bool, error) {
if entity.Validated {
return true, 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
Function validLocation
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
validLocation() {
switch (this.layout) {
case Layouts.BIRTHPLACE:
if (this.isDomestic()) {
return this.validFields(['city', 'state', 'county'])
- 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 ResidenceWrapper
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const ResidenceWrapper = (props) => {
const {
applicantBirthdate, formType, errors, data,
} = props
- 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 content
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
content() {
const {
items, valueKey, branchName, label, labelSize, help, content, onError,
branchClassName, appendLabel, appendSize, appendContent, children,
} = this.props
- 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 dateRangeValidator
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const dateRangeValidator = (value = {}, options, key, attributes, globalOptions) => {
if (validate.isEmpty(value)) return null // Don't validate if there is no value
const { from, present } = value
const to = present
- 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 EmploymentWrapper
has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring. Open
const EmploymentWrapper = (props) => {
const {
formType, errors, applicantBirthdate, data,
} = props
- 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"