Showing 132 of 502 total issues
Function func
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
func: (value, props) => {
if (!props.required) {
return true
}
- 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 CivilUnion.Unmarshal
has 22 return statements (exceeds 10 allowed). Open
func (entity *CivilUnion) Unmarshal(raw []byte) error {
err := json.Unmarshal(raw, entity)
if err != nil {
return err
}
Function render
has 266 lines of code (exceeds 255 allowed). Consider refactoring. Open
render() {
const { prefix } = this.props
return (
<div className="interest">
<Field
Function flattenObject
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const flattenObject = obj => {
let s = ''
let what = Object.prototype.toString.call(obj)
switch (what) {
case '[object Object]':
- 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 TelephoneSummary
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
export const TelephoneSummary = (props, unknown = '') => {
if (!props) {
return unknown
}
- 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 265 lines of code (exceeds 255 allowed). Consider refactoring. Open
render() {
const { requireExpirationDate } = this.props
return (
<div className="foreign-born-documents">
<Field
Method applicationPackager.locationOverrideLayout
has 19 return statements (exceeds 10 allowed). Open
func (p applicationPackager) locationOverrideLayout(data map[string]interface{}, override string) (template.HTML, error) {
// Deserialize the initial payload from a JSON structure
payload := &api.Payload{}
// entity, err := payload.UnmarshalEntity(getInterfaceAsBytes(data))
entity, err := payload.UnmarshalEntity(getInterfaceAsBytes(data))
Function appropriateValue
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
appropriateValue(value, multiple = false) {
if (!value) {
if (multiple) {
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 populateCurrentAddress
has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring. Open
export const populateCurrentAddress = history => {
const items = (((history || {}).Residence || {}).List || {}).items || []
if (items.length === 0) {
return history
}
- 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 a Cognitive Complexity of 26 (exceeds 20 allowed). Consider refactoring. Open
func (entity *CitizenshipStatus) Unmarshal(raw []byte) error {
err := json.Unmarshal(raw, entity)
if err != nil {
return err
}
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { selectedValue } = this.props;
const name = this.props.name ? `${this.state.uid}-${this.props.name}` : null
const children = React.Children.map(this.props.children, child => {
// If type is not Radio, stop
- 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 Benefit.Unmarshal
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
func (entity *Benefit) Unmarshal(raw []byte) error {
err := json.Unmarshal(raw, entity)
if err != nil {
return err
}
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
render() {
const { prefix } = this.props
const klass = [
`name ${this.props.className || ''}`.trim(),
this.props.disabled ? 'disabled' : '',
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
render() {
const children = React.Children.map(this.props.children, checkbox => {
let checked = null
// Handle empty array case so that .find() doesn't error
- 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.Marshal
has a Cognitive Complexity of 25 (exceeds 20 allowed). Consider refactoring. Open
func (entity *CitizenshipStatus) Marshal() Payload {
if entity.CitizenshipStatus != nil {
entity.PayloadCitizenshipStatus = entity.CitizenshipStatus.Marshal()
}
if entity.AbroadDocumentation != 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 InjectGaps
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
export const InjectGaps = (list = [], start) => {
// Let us just make sure we clear any previous gaps
list = list.filter(item => !item.type || (item.type && item.type !== 'Gap'))
const hasDates = (item) => {
- 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 10 (exceeds 5 allowed). Consider refactoring. Open
render() {
if (!this.allowed()) {
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 arrayValidator
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const arrayValidator = (value, options, key, attributes, globalOptions) => {
if (validate.isEmpty(value)) return null // Don't validate if there is no value
const { values } = value
if (!values) return MISSING_ITEMS
- 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 letters
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
const letters = obj => {
if (!obj) {
return 0
}
- 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
Consider simplifying this complex logical expression. Open
if (attributes.Status
&& attributes.Status.value
&& (previouslyMarriedOptions.indexOf(attributes.Status.value) > -1
|| (marriedOptions.indexOf(attributes.Status.value) > -1
&& attributes.CivilUnion && attributes.CivilUnion.Divorced