department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

File blueButton.js has 305 lines of code (exceeds 250 allowed). Consider refactoring.
Open

import { formatDateLong } from '@department-of-veterans-affairs/platform-utilities/exports';
import { pharmacyPhoneNumber } from '@department-of-veterans-affairs/mhv/exports';
import { format, isAfter } from 'date-fns';
import { capitalize } from 'lodash';
import { Actions } from '../util/actionTypes';
Severity: Minor
Found in src/applications/mhv-medical-records/reducers/blueButton.js - About 3 hrs to fix

    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 HealthConditions has 83 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const HealthConditions = () => {
        const ABOUT_THE_CODES_LABEL = 'About the codes in some condition names';
        const dispatch = useDispatch();
        const updatedRecordList = useSelector(
          state => state.mr.conditions.updatedList,
      Severity: Major
      Found in src/applications/mhv-medical-records/containers/HealthConditions.jsx - About 3 hrs to fix

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

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

          File RequestedAppointmentsPage.unit.spec.js has 304 lines of code (exceeds 250 allowed). Consider refactoring.
          Open

          import { mockFetch } from '@department-of-veterans-affairs/platform-testing/helpers';
          import { expect } from 'chai';
          import MockDate from 'mockdate';
          import moment from 'moment';
          import React from 'react';

            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 ApplicationSelector has 82 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const ApplicationSelector = () => {
                const [searchTerm, setSearchTerm] = useState('');
              
                // a stand-in for the actual process config for now
                const processConfig = {

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

                const ReviewPage = props => {
                  const { location } = props;
                  const [privacyCheckbox, setPrivacyCheckbox] = useState(false);
                  const [submitted, setSubmitted] = useState(false);
                
                

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

                    const ReviewCardField = ({
                      uiSchema,
                      schema,
                      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 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

                    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

                    Severity
                    Category
                    Status
                    Source
                    Language