18F/e-QIP-prototype

View on GitHub

Showing 502 of 502 total issues

Function accordionValidator has a Cognitive Complexity of 30 (exceeds 5 allowed). Consider refactoring.
Open

const accordionValidator = (value, options, key, attributes, globalOptions) => {
  if (validate.isEmpty(value)) return null // Don't validate if there is no value

  const {
    validator, length, ignoreBranch, itemsValidator,
Severity: Minor
Found in src/models/validators/accordion.js - About 4 hrs to fix

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 Review has a Cognitive Complexity of 28 (exceeds 5 allowed). Consider refactoring.
Open

const Review = (props) => {
  const {
    applicantBirthdate, Education, Residence, Employment, formType, requireHistoryFederalSection,
    forPrint,
    errors,
Severity: Minor
Found in src/components/Section/History/Review.jsx - About 4 hrs to fix

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

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        <CoOwners
          prefix={prefix}
          {...this.props.CoOwners}
          addressBooks={this.props.addressBooks}
          dispatch={this.props.dispatch}
src/components/Section/Foreign/Activities/DirectActivity/DirectInterest.jsx on lines 334..343

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 111.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Identical blocks of code found in 2 locations. Consider refactoring.
Open

        <CoOwners
          prefix={prefix}
          {...this.props.CoOwners}
          addressBooks={this.props.addressBooks}
          dispatch={this.props.dispatch}
src/components/Section/Foreign/Activities/IndirectActivity/IndirectInterest.jsx on lines 404..413

Duplicated Code

Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

Tuning

This issue has a mass of 111.

We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

Refactorings

Further Reading

Function render has 321 lines of code (exceeds 255 allowed). Consider refactoring.
Open

  render() {
    const { recordYears } = this.props
    const activity = (this.props.EmploymentActivity || {}).value
    const prefix = `history.employment.${this.localizeByActivity()}`.trim()

Severity: Major
Found in src/components/Section/History/Employment/EmploymentItem.jsx - About 3 hrs to fix

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

      Resolved: (value, attributes) => {
        const { ResolvedNotApplicable } = attributes
        if (ResolvedNotApplicable && ResolvedNotApplicable.applicable === false) {
          return {}
        }
    Severity: Major
    Found in src/models/financialNonpayment.js and 1 other location - About 3 hrs to fix
    src/models/financialDelinquentPayments.js on lines 57..69

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 107.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Identical blocks of code found in 2 locations. Consider refactoring.
    Open

      Resolved: (value, attributes) => {
        const { ResolvedNotApplicable } = attributes
        if (ResolvedNotApplicable && ResolvedNotApplicable.applicable === false) {
          return {}
        }
    Severity: Major
    Found in src/models/financialDelinquentPayments.js and 1 other location - About 3 hrs to fix
    src/models/financialNonpayment.js on lines 48..60

    Duplicated Code

    Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

    Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

    When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

    Tuning

    This issue has a mass of 107.

    We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

    The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

    If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

    See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

    Refactorings

    Further Reading

    Function render has 317 lines of code (exceeds 255 allowed). Consider refactoring.
    Open

      render() {
        const {
          requireLegalOffenseInvolvements,
          requireLegalOffenseSentenced,
          requireLegalOffenseIncarcerated,
    Severity: Major
    Found in src/components/Section/Legal/Police/Offense.jsx - About 3 hrs to fix

      Function render has 315 lines of code (exceeds 255 allowed). Consider refactoring.
      Open

        render() {
          const book = this.props.addressBooks[this.props.addressBook] || []
          const locationValidator = new LocationValidator(this.props)
          const instateZipcode = locationValidator.validZipcodeState()
      
      
      Severity: Major
      Found in src/components/Form/Location/Address.jsx - About 3 hrs to fix

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

            for (const e of arr) {
              const idx = errors.findIndex(x => x.uid === e.uid && x.code === e.code)
              if (idx !== -1) {
                errors[idx] = { ...e }
              } else {
        Severity: Major
        Found in src/components/Form/DateRange/DateRange.jsx and 2 other locations - About 3 hrs to fix
        src/components/Form/Field/Field.jsx on lines 124..131
        src/components/Form/NotApplicable/NotApplicable.jsx on lines 53..62

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 98.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

            arr.forEach((e) => {
              const idx = errors.findIndex(x => x.uid === e.uid && x.code === e.code)
              if (idx !== -1) {
                errors[idx] = { ...e }
              } else {
        Severity: Major
        Found in src/components/Form/Field/Field.jsx and 2 other locations - About 3 hrs to fix
        src/components/Form/DateRange/DateRange.jsx on lines 136..143
        src/components/Form/NotApplicable/NotApplicable.jsx on lines 53..62

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 98.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 3 locations. Consider refactoring.
        Open

                  for (const e of arr) {
                    const idx = errors.findIndex(
                      x => x.uid === e.uid && x.code === e.code
                    )
                    if (idx !== -1) {
        Severity: Major
        Found in src/components/Form/NotApplicable/NotApplicable.jsx and 2 other locations - About 3 hrs to fix
        src/components/Form/DateRange/DateRange.jsx on lines 136..143
        src/components/Form/Field/Field.jsx on lines 124..131

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 98.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            const errors =
              this.props.onError(
                value,
                this.constructor.errors.map(err => {
                  return {
        Severity: Major
        Found in src/components/Form/Radio/Radio.jsx and 1 other location - About 3 hrs to fix
        src/components/Form/Checkbox/Checkbox.jsx on lines 87..97

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 97.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Identical blocks of code found in 2 locations. Consider refactoring.
        Open

            const errors =
              this.props.onError(
                value,
                this.constructor.errors.map(err => {
                  return {
        Severity: Major
        Found in src/components/Form/Checkbox/Checkbox.jsx and 1 other location - About 3 hrs to fix
        src/components/Form/Radio/Radio.jsx on lines 148..158

        Duplicated Code

        Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

        Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

        When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

        Tuning

        This issue has a mass of 97.

        We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

        The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

        If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

        See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

        Refactorings

        Further Reading

        Function tabology has a Cognitive Complexity of 19 (exceeds 5 allowed). Consider refactoring.
        Open

        const tabology = () => {
          const tabable = !document.body.classList.contains('modal-open')
          const focusable = [
            'a[href]',
            'area[href]',
        Severity: Minor
        Found in src/plugins/tabology.js - About 2 hrs to fix

        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

        File foreign.go has 774 lines of code (exceeds 750 allowed). Consider refactoring.
        Open

        package api
        
        import (
            "encoding/json"
            "fmt"
        Severity: Major
        Found in api/foreign.go - About 2 hrs to fix

          Function render has 293 lines of code (exceeds 255 allowed). Consider refactoring.
          Open

            render() {
              const {
                requireForeignCounterIntelligence,
                requireForeignExcessiveKnowledge,
                requireForeignSensitiveInformation,
          Severity: Major
          Found in src/components/Section/Foreign/Travel/TravelQuestions.jsx - About 2 hrs to fix

            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'
            Severity: Major
            Found in src/components/Form/Location/Location.jsx - About 2 hrs to fix

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                update(updateValues) {
                  if (this.props.onUpdate) {
                    this.props.onUpdate({
                      Description: this.props.Description,
                      InvolvementDates: this.props.InvolvementDates,
              src/components/Section/SubstanceUse/Drugs/DrugClearanceUse.jsx on lines 21..30

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 82.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Identical blocks of code found in 2 locations. Consider refactoring.
              Open

                update(updateValues) {
                  if (this.props.onUpdate) {
                    this.props.onUpdate({
                      Description: this.props.Description,
                      InvolvementDates: this.props.InvolvementDates,
              src/components/Section/SubstanceUse/Drugs/DrugPublicSafetyUse.jsx on lines 21..30

              Duplicated Code

              Duplicated code can lead to software that is hard to understand and difficult to change. The Don't Repeat Yourself (DRY) principle states:

              Every piece of knowledge must have a single, unambiguous, authoritative representation within a system.

              When you violate DRY, bugs and maintenance problems are sure to follow. Duplicated code has a tendency to both continue to replicate and also to diverge (leaving bugs as two similar implementations differ in subtle ways).

              Tuning

              This issue has a mass of 82.

              We set useful threshold defaults for the languages we support but you may want to adjust these settings based on your project guidelines.

              The threshold configuration represents the minimum mass a code block must have to be analyzed for duplication. The lower the threshold, the more fine-grained the comparison.

              If the engine is too easily reporting duplication, try raising the threshold. If you suspect that the engine isn't catching enough duplication, try lowering the threshold. The best setting tends to differ from language to language.

              See codeclimate-duplication's documentation for more information about tuning the mass threshold in your .codeclimate.yml.

              Refactorings

              Further Reading

              Severity
              Category
              Status
              Source
              Language