department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,848 of 12,848 total issues

Function getAppeals has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function getAppeals() {
  const startTimestampMs = Date.now();

  return dispatch => {
    dispatch({ type: FETCH_APPEALS_PENDING });
Severity: Minor
Found in src/applications/personalization/dashboard/actions/appeals.js - About 1 hr to fix

    Function getBlueButtonReportData has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export const getBlueButtonReportData = () => async dispatch => {
      try {
        const [
          labs,
          notes,
    Severity: Minor
    Found in src/applications/mhv-medical-records/actions/blueButtonReport.js - About 1 hr to fix

      Function Alert has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Alert = props => {
        const { isAlertVisible, paginatedPrescriptionsList } = props;
      
        return (
          <div className={`${isAlertVisible ? 'vads-u-margin-top--5' : ''}`}>
      Severity: Minor
      Found in src/applications/mhv-medications/components/shared/Alert.jsx - About 1 hr to fix

        Function Search has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const Search = ({ searchDropdownComponentEnabled }) => {
          const [term, setTerm] = useState('');
        
          const onFormSubmit = event => {
            event.preventDefault();
        Severity: Minor
        Found in src/platform/site-wide/header/components/Search/index.js - About 1 hr 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 updateFormDataAddress has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const updateFormDataAddress = (
          oldFormData,
          formData,
          path,
          index = null, // this is included in the path, but added as

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

        export default function FormNav(props) {
          const {
            formConfig = {},
            currentPath,
            formData,
        Severity: Minor
        Found in src/platform/forms-system/src/js/components/FormNav.jsx - About 1 hr 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 updateFormDataAddress has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const updateFormDataAddress = (
          oldFormData,
          formData,
          path,
          index = null, // this is included in the path, but added as
        Severity: Minor
        Found in src/platform/forms-system/src/js/definitions/profileAddress.js - About 1 hr 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 getPropertyInfo has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const getPropertyInfo = (pageList = [], name, instance = '') => {
          const findPageIndex = (
            obj,
            insideInstance = instance === '' || instance === name,
          ) => {
        Severity: Minor
        Found in src/platform/forms-system/src/js/utilities/data/reduceErrors.js - About 1 hr 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 navigateBackward has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const navigateBackward = (SHORT_NAME, formResponses, router) => {
          const roadmap = makeRoadmap(getServicePeriodResponse(formResponses));
        
          if (roadmap?.length) {
            const CURRENT_INDEX = roadmap?.indexOf(SHORT_NAME);
        Severity: Minor
        Found in src/applications/pact-act/utilities/page-navigation.js - About 1 hr 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 applyFocus has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const applyFocus = (parentId, headerHasFocused, setHeaderHasFocused) => {
          if (!headerHasFocused) {
            setTimeout(() => {
              const header = document
                .getElementById(parentId)
        Severity: Minor
        Found in src/applications/pact-act/utilities/page-setup.js - About 1 hr 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 IntroductionLoginV2 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        function IntroductionLoginV2({
          isClaimantCallComplete,
          isEligibilityCallComplete,
          isPersonalInfoFetchFailed,
          isLoggedIn,

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

        const BenefitRelinquishWidget = ({ formData, setFormData }) => {
          const { eligibility } = formData;
          const [selected, setSelected] = useState('');
        
          const chapter30 = eligibility?.includes('Chapter30');

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

        export function prefillTransformerV4(pages, formData, metadata, state) {
          const bankInformation = state.data?.bankInformation || {};
          const claimant = state.data?.formData?.data?.attributes?.claimant || {};
          const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
          const contactInfo = claimant?.contactInfo || {};
        Severity: Minor
        Found in src/applications/my-education-benefits/helpers.js - About 1 hr 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 prefillTransformer has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function prefillTransformer(pages, formData, metadata) {
          const newFormData = formData;
        
          for (const addressType of ['permanentAddress', 'temporaryAddress']) {
            if (newFormData[addressType]?.country) {

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

        const checkExtraConditions = (benefit, formData) => {
          let result = true;
        
          if (benefit.extraConditions) {
            if (benefit.extraConditions.oneIsNotBlank) {

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

        export function prefillTransformerV1(pages, formData, metadata, state) {
          const bankInformation = state.data?.bankInformation || {};
          const claimant = state.data?.formData?.data?.attributes?.claimant || {};
          const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
          const contactInfo = claimant?.contactInfo || {};
        Severity: Minor
        Found in src/applications/my-education-benefits/helpers.js - About 1 hr 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 prefillTransformerV2 has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export function prefillTransformerV2(pages, formData, metadata, state) {
          const bankInformation = state.data?.bankInformation || {};
          const claimant = state.data?.formData?.data?.attributes?.claimant || {};
          const serviceData = state.data?.formData?.data?.attributes?.serviceData || [];
          const contactInfo = claimant?.contactInfo || {};
        Severity: Minor
        Found in src/applications/my-education-benefits/helpers.js - About 1 hr 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 submitForm has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        const submitForm = (form, formConfig, submissionId) => {
          const formWithSubmissionId = {
            ...form,
            data: {
              ...form.data,
        Severity: Minor
        Found in src/applications/coronavirus-research/update/config/submitForm.js - About 1 hr 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 applyFocus has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const applyFocus = (parentId, headerHasFocused, setHeaderHasFocused) => {
          if (!headerHasFocused) {
            setTimeout(() => {
              const header = document
                .getElementById(parentId)
        Severity: Minor
        Found in src/applications/discharge-wizard/utilities/page-setup.js - About 1 hr 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 transform has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export function transform(formConfig, form) {
          const newSchoolTransform = formData => {
            let clonedData = _.cloneDeep(formData);
            delete clonedData.newSchoolName;
            delete clonedData.newSchoolAddress;
        Severity: Minor
        Found in src/applications/edu-benefits/1995/config/submit-transformer.js - About 1 hr 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

        Severity
        Category
        Status
        Source
        Language