department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function NotificationChannel has 83 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const NotificationChannel = props => {
  const {
    apiStatus,
    channelId,
    channelType,

    Function hcaEnrollmentStatus has 83 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function hcaEnrollmentStatus(state = initialState, action) {
      const { data = {}, response = {}, type } = action;
      const {
        FETCH_ENROLLMENT_STATUS_STARTED,
        FETCH_ENROLLMENT_STATUS_SUCCEEDED,

      Function content has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        const content = () => {
          if (accessAlert) {
            return (
              <AccessTroubleAlertBox
                alertType={accessAlertTypes.HEALTH_CONDITIONS}
      Severity: Major
      Found in src/applications/mhv-medical-records/containers/ConditionDetails.jsx - About 3 hrs to fix

        Function MedicationsList has 83 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const MedicationsList = props => {
          const history = useHistory();
          const {
            rxList,
            pagination,

          Function AllergiesPrintOnly has 83 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const AllergiesPrintOnly = props => {
            const { allergies } = props;
          
            const content = () => {
              return (

            Function mapRawUserDataToState has 82 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export function mapRawUserDataToState(json) {
              const {
                data: {
                  attributes: {
                    account: { accountUuid } = {},
            Severity: Major
            Found in src/platform/user/profile/utilities/index.js - About 3 hrs to fix

              Function data has 82 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                data: (state = initialState, action) => {
                  switch (action.type) {
                    case FETCH_POST_911_GI_BILL_ELIGIBILITY_SUCCESS:
                      return {
                        ...state,
              Severity: Major
              Found in src/applications/enrollment-verification/reducers/index.js - About 3 hrs to fix

                Function render has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                  render() {
                    const { form } = this.props;
                    const { submission, data } = form;
                
                    const submitDate = new Date(submission?.timestamp);

                  Function createClaimsSuccess has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const createClaimsSuccess = (updatedDaysAgo = 1, open = true) => {
                    const daysAgo = subDays(new Date(), updatedDaysAgo);
                    const formattedDaysAgo = format(daysAgo, 'yyyy-MM-dd');
                    return {
                      data: [
                  Severity: Major
                  Found in src/applications/personalization/dashboard/mocks/claims/index.js - About 3 hrs to fix

                    Function prefillTransformer has 82 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function prefillTransformer(pages, formData, metadata) {
                      const prefillPersonalInformation = data => {
                        const newData = _.omit(['personalInformation'], data);
                        const { personalInformation } = data;
                    
                    
                    Severity: Major
                    Found in src/applications/representative-appoint/prefill-transformer.js - About 3 hrs to fix

                      Function render has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                      Open

                        render() {
                          const {
                            uiSchema,
                            errorSchema,
                            idSchema,
                      Severity: Minor
                      Found in src/platform/forms-system/src/js/fields/ObjectField.jsx - About 3 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 setHiddenFields has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function setHiddenFields(schema, uiSchema, formData, path = []) {
                        if (!uiSchema) {
                          return schema;
                        }
                      
                      
                      Severity: Minor
                      Found in src/platform/forms-system/src/js/state/helpers.js - About 3 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 a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                      Open

                        render() {
                          const { uiSchema, errorSchema, idSchema, schema, formContext } = this.props;
                          const { SchemaField } = this.props.registry.fields || {};
                      
                          const properties = Object.keys(schema.properties);
                      Severity: Minor
                      Found in src/platform/forms-system/src/js/review/ObjectField.jsx - About 3 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 a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                      Open

                        render() {
                          const {
                            uiSchema,
                            errorSchema,
                            idSchema,

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

                      const AddIssue = ({
                        validations,
                        description,
                        data,
                        goToPath,
                      Severity: Minor
                      Found in src/applications/appeals/shared/components/AddIssue.jsx - About 3 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 FileFieldCustom has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                      Open

                      export function FileFieldCustom(props) {
                        const updateButton = (
                          // eslint-disable-next-line @department-of-veterans-affairs/prefer-button-component
                          <button type="submit" onClick={props.updatePage}>
                            Update page

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

                      const ContactInfo = ({
                        data,
                        goBack,
                        goForward,
                        onReviewPage,

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

                      export const Form526Entry = ({
                        children,
                        inProgressFormId,
                        isBDDForm,
                        location,
                      Severity: Minor
                      Found in src/applications/disability-benefits/all-claims/Form526EZApp.jsx - About 3 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 Typeahead has a Cognitive Complexity of 23 (exceeds 5 allowed). Consider refactoring.
                      Open

                      const Typeahead = ({ uiSchema, idSchema, formData, onChange, onBlur }) => {
                        const [input, setInput] = useState('');
                        const [suggestions, setSuggestions] = useState([]);
                      
                        const getInput = useCallback(

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

                      const PayrollDeductionInputList = props => {
                        const { goToPath, goBack, setFormData } = props;
                      
                        const editIndex = getJobIndex();
                      
                      

                      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

                      Severity
                      Category
                      Status
                      Source
                      Language