department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function OtherAssetsInputList has 65 lines of code (exceeds 25 allowed). Consider refactoring.
Open

const OtherAssetsInputList = props => {
  const { errorSchema, formContext } = props;
  const errorList = errorSchema?.otherAssets?.__errors;
  const { submitted } = formContext;

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

      render() {
        let buttonText;
        let buttonDisabled; // false causes MS Voice Access to ignore buttons
        let message;
        switch (this.props.downloadStatus) {
    Severity: Major
    Found in src/applications/letters/components/DownloadLetterLink.jsx - About 2 hrs to fix

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

        render() {
          const {
            appeal,
            fullName,
            appealsLoading,
      Severity: Major
      Found in src/applications/claims-status/containers/AppealInfo.jsx - About 2 hrs to fix

        Function toggleSMSNotificationsSuccess has 65 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const toggleSMSNotificationsSuccess = (enrolled = true) => {
          return [
            rest.put(`${prefix}/v0/profile/telephones`, (req, res, ctx) => {
              return res(
                ctx.json({
        Severity: Major
        Found in src/applications/personalization/profile/msw-mocks.js - About 2 hrs to fix

          Function generateAllergyItem has 65 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const generateAllergyItem = record => {
            if (record.isOracleHealthData) {
              return {
                items: [
                  {
          Severity: Major
          Found in src/applications/mhv-medical-records/util/pdfHelpers/allergies.js - About 2 hrs to fix

            Function generateMicrobioContent has 65 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export const generateMicrobioContent = record => {
              const content = {
                details: {
                  header: 'Details about this test',
                  sectionSeparators: false,
            Severity: Major
            Found in src/applications/mhv-medical-records/util/pdfHelpers/labsAndTests.js - About 2 hrs to fix

              Function folders has 65 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function folders(state = initialState, action) {
                switch (action.type) {
                  case FETCH_FOLDER_SUCCESS: {
                    const { attributes } = action.folder.data;
                    const messages = action.messages.data.map(message => message.attributes);
              Severity: Major
              Found in src/applications/personalization/dashboard/reducers/folders.js - About 2 hrs to fix

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

                const generateResultItemContent = async (
                  item,
                  doc,
                  results,
                  hasHorizontalRule,
                Severity: Minor
                Found in src/platform/pdf/templates/blue_button_report.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

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

                export const buildAddressArray = (location, titleCaseText = false) => {
                  if (location && location.type === 'provider') {
                    const { address } = location.attributes;
                
                    if (!isEmpty(address)) {
                Severity: Minor
                Found in src/platform/utilities/facilities-and-mapbox/index.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

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

                  UNSAFE_componentWillReceiveProps(newProps) {
                    // When a user is logged in, the profile finishes loading after the component
                    //  has mounted, so we check here.
                    // If we're done loading the profile, check to see if we should load or redirect
                    if (
                Severity: Minor
                Found in src/platform/forms/save-in-progress/RoutedSavableApp.jsx - 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

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

                export function PreSubmitSection(props) {
                  const {
                    form,
                    preSubmit = {},
                    setPreSubmit,
                Severity: Minor
                Found in src/platform/forms/components/review/PreSubmitSection.jsx - 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

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

                export function createStringifyFormReplacer(options) {
                  /**
                   * Replaces values based on a set of rules.
                   *
                   * @param {*} key

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

                export function prefillTransformerV3(pages, formData, metadata, state) {
                  const bankInformation = state.data?.bankInformation || {};
                  const claimant = state.data?.formData?.data?.attributes?.claimant || {};
                  const exclusionPeriods = Array.isArray(state.data?.exclusionPeriods)
                    ? state.data?.exclusionPeriods
                Severity: Minor
                Found in src/applications/my-education-benefits/helpers.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

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

                export const InformalConference = ({
                  data,
                  goBack,
                  goForward,
                  onReviewPage,
                Severity: Minor
                Found in src/applications/appeals/996/components/InformalConference.jsx - 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

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

                const DependentsPage = ({
                  dependents,
                  editMode,
                  pastMode,
                  router,
                Severity: Minor
                Found in src/applications/income-limits/containers/DependentsPage.jsx - 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

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

                export const ConfirmationPageV2 = () => {
                  const form = useSelector(state => state.form || {});
                  const profile = useSelector(state => selectProfile(state));
                
                  // Fix this after Lighthouse sets up the download URL
                Severity: Minor
                Found in src/applications/appeals/995/components/ConfirmationPageV2.jsx - 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

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

                const ShowAlertOrSip = ({ basename, sipOptions, bottom }) => {
                  const loggedIn = useSelector(isLoggedIn);
                  // Verified LOA3?
                  const isVerified = useSelector(
                    state => selectProfile(state)?.verified || false,
                Severity: Minor
                Found in src/applications/appeals/shared/components/ShowAlertOrSip.jsx - 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

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

                const LevelThreeLinks = ({
                  activeMenu,
                  menuSections,
                  setLevelTwoMenuOpen,
                  setLinkShouldFocus,

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

                const ShowAlertOrSip = ({ basename, sipOptions, bottom }) => {
                  const loggedIn = useSelector(isLoggedIn);
                  // Verified LOA3?
                  const isVerified = useSelector(
                    state => selectProfile(state)?.verified || false,

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

                export default function V1V3Page() {
                  /** @param {import('react').FormEvent | import('@department-of-veterans-affairs/web-components/dist/types/components').VaSelectCustomEvent } evt */
                  function updateValue(evt) {
                    const { value, name } = /** @type {HTMLInputElement} */ (evt.target);
                    const display = document.getElementById(`${name}Value`);
                Severity: Minor
                Found in src/applications/ds-playground/pages/V1V3Page.jsx - 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

                Severity
                Category
                Status
                Source
                Language