department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,848 of 12,848 total issues

Function mapElement has 36 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const mapElement = (visible = true) => {
    const containerClassNames = classNames({
      'vads-u-display--none': !visible,
    });
    const isMobileDevice = smallScreen || landscape;
Severity: Minor
Found in src/applications/gi/containers/search/LocationSearchResults.jsx - About 1 hr to fix

    Function ViewDependentsLists has 36 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    function ViewDependentsLists(props) {
      const onAwardSubhead = (
        <>
          The following dependents have been added to your VA benefits. Please let
          us know if a dependent’s status has changed.

      Function useDowntimeApproachingRenderMethod has 36 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function useDowntimeApproachingRenderMethod() {
        const [modalDismissed, setModalDismissed] = useState(false);
      
        return (downtime, children) => {
          if (downtime.status === externalServiceStatus.downtimeApproaching) {

        Function DisabilityRating has 36 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const DisabilityRating = () => {
          const hasError = useSelector(totalDisabilityError);
          const rating = useSelector(state => state.totalRating?.totalDisabilityRating);
          const canAccessRatingInfo = useSelector(canAccess)?.[API_NAMES.RATING_INFO];
        
        

          Function NoServiceHistoryAlert has 36 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const NoServiceHistoryAlert = () => {
            return (
              <>
                <va-alert status="warning" uswds class="vads-u-margin-bottom--4">
                  <h2 slot="headline">

            Function sections has 36 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

                  .map(listItem => {
                    const object = { header: '', headerSize: 'H2', items: [] };
                    object.header = listItem.text;
                    const index = list.indexOf(listItem);
                    const nextHeader = list
            Severity: Minor
            Found in src/applications/mhv-medications/util/pdfConfigs.js - About 1 hr to fix

              Function generateResultItemContent has a Cognitive Complexity of 12 (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 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 MenuItemLevel1 has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              export const MenuItemLevel1 = ({
                expandedMenuID,
                item,
                updateExpandedMenuID,
              }) => {
              Severity: Minor
              Found in src/platform/site-wide/header/components/MenuItemLevel1/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 render has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

                render() {
                  const { idSchema, formContext, formData, uiSchema, schema } = this.props;
                  const id = idSchema.$id;
              
                  // wrap matching text in a <span> element
              Severity: Minor
              Found in src/platform/forms-system/src/js/fields/AutosuggestField.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 checkTypeAndExtensionMatches has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function checkTypeAndExtensionMatches({ file, result }) {
                // file.name and file.type may be undefined in some browsers, see
                // https://developer.mozilla.org/en-US/docs/Web/API/File#browser_compatibility
                const extension = (file.name || '')
                  .toLowerCase()

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

              export const determineResultsPage = (formResponses, router) => {
                const responseToServicePeriod = getServicePeriodResponse(formResponses);
                const { RESULTS_4 } = SHORT_NAME_MAP;
              
                const resultsPages = DISPLAY_CONDITIONS?.RESULTS;
              Severity: Minor
              Found in src/applications/pact-act/utilities/display-logic-results.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 sessionTypeUrl has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              export function sessionTypeUrl({
                type = '',
                queryParams = {},
                version = API_VERSION,
                allowVerification = false,
              Severity: Minor
              Found in src/platform/user/authentication/utilities.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 getLatestDebt has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              export const getLatestDebt = debts => {
                return debts
                  ? debts.reduce((acc, curr) => {
                      const mostRecentHistory = head(curr.debtHistory);
                      if (mostRecentHistory) {

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

              export const getLatestBill = bills => {
                return bills
                  ? bills.reduce((acc, currBill) => {
                      if (currBill.pSStatementDateOutput) {
                        if (!acc) {

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

              const AreaOfDisagreement = ({
                data = {},
                pagePerItemIndex,
                goBack,
                goForward,

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

              export const answerReview = (key, formValues) => {
                const ans = formValues[key];
                const dischargeYearLabel = prevApplicationYearCutoff[formValues['4_reason']];
                const monthObj = options.months.find(
                  m => String(m.value) === formValues['3_dischargeMonth'],
              Severity: Minor
              Found in src/applications/discharge-wizard/helpers/index.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 InboxPage has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              const InboxPage = ({
                claimStatus,
                getClaimStatus,
                user,
                MEBClaimStatusFetchInProgress,
              Severity: Minor
              Found in src/applications/education-letters/containers/InboxPage.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 DependentSummary has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              const DependentSummary = props => {
                const {
                  data,
                  goBack,
                  goForward,
              Severity: Minor
              Found in src/applications/ezr/components/FormPages/DependentSummary.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 PreSubmitNotice has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              function PreSubmitNotice({
                formData,
                showError,
                onSectionComplete,
                setPreSubmit,
              Severity: Minor
              Found in src/applications/edu-benefits/5490/containers/PreSubmitInfo.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 DownloadHandler has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
              Open

              const DownloadHandler = ({
                clickedId,
                downloadUrl,
                form,
                formNumber,

              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