18F/e-QIP-prototype

View on GitHub

Showing 132 of 502 total issues

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

  render() {
    const {
      CitizenshipStatus,
      AbroadDocumentation,
      Explanation,
Severity: Major
Found in src/components/Section/Citizenship/Status/Status.jsx - About 3 days to fix

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

      render() {
        const {
          requireRelationshipRelativesForeignBornDoc,
          requireRelationshipRelativesUSResidenceDoc,
          requireRelationshipRelativesForeignGovtAffExplanation,
    Severity: Major
    Found in src/components/Section/Relationships/Relatives/Relative.jsx - About 2 days to fix

      Function sectionData has 573 lines of code (exceeds 255 allowed). Consider refactoring.
      Open

      const sectionData = (section, subsection, application = {}) => {
        if (!section || !subsection || !application) {
          return []
        }
      
      
      Severity: Major
      Found in src/components/Section/sectionData.js - About 1 day to fix

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

          render() {
            const foreignContactMinDate = pickDate([this.props.applicantBirthdate, this.props.Birthdate])
            return (
              <div className="foreign-national">
                <Field
        Severity: Major
        Found in src/components/Section/Foreign/Contacts/ForeignNational.jsx - About 1 day to fix

          transform has 111 functions (exceeds 50 allowed). Consider refactoring.
          Open

          const transform = {
            benefit: data => form.benefit(data),
            branch: data => form.branch(data),
            checkbox: data => form.checkbox(data),
            checkboxgroup: data => form.checkboxgroup(data),
          Severity: Major
          Found in src/schema/schema.js - About 1 day to fix

            File Status.jsx has 1056 lines of code (exceeds 750 allowed). Consider refactoring.
            Open

            import React from 'react'
            import { i18n } from 'config'
            import { alphaNumericRegEx, validGenericTextfield } from 'validators/helpers'
            import { isDocumentRequired, isCertificateRequired } from 'validators/citizenship'
            import {
            Severity: Major
            Found in src/components/Section/Citizenship/Status/Status.jsx - About 1 day to fix

              File Relative.jsx has 1055 lines of code (exceeds 750 allowed). Consider refactoring.
              Open

              /* eslint jsx-a11y/label-has-associated-control: 0 */
              /* eslint jsx-a11y/label-has-for: 0 */
              
              import React from 'react'
              import { i18n } from 'config'
              Severity: Major
              Found in src/components/Section/Relationships/Relatives/Relative.jsx - About 1 day to fix

                File xml.go has 988 lines of code (exceeds 750 allowed). Consider refactoring.
                Open

                package xml
                
                import (
                    "bytes"
                    "encoding/json"
                Severity: Major
                Found in api/xml/xml.go - About 7 hrs to fix

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

                    render() {
                      /**
                       * `this.props.BirthPlace` can end up in a number of different states,
                       * depending on the choices a user makes in this section _and_ on
                       * the initial state of the app.

                    File zipcodes.js has 913 lines of code (exceeds 750 allowed). Consider refactoring.
                    Open

                    export const zipcodes = {
                      AA: ['340'],
                      AE: ['090', '091', '092', '093', '094', '095', '096', '097', '098', '099'],
                      AP: ['962', '963', '964', '965', '966'],
                      AK: ['995', '996', '997', '998', '999'],
                    Severity: Major
                    Found in src/config/zipcodes.js - About 5 hrs to fix

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

                        render() {
                          // Certain elements are present if the date range of the residency was
                          // within the last 3 years.
                          const dates = this.props.Dates || {}
                          const from = extractDate(dates.from)
                      Severity: Major
                      Found in src/components/Section/History/Residence/ResidenceItem.jsx - About 5 hrs to fix

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

                          render() {
                            return (
                              <div className="military-service">
                                <Field
                                  title={i18n.t('military.history.heading.service')}
                        Severity: Major
                        Found in src/components/Section/Military/History/MilitaryService.jsx - About 4 hrs to fix

                          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

                          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

                            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

                                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
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language