department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,732 of 12,811 total issues

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 { currentLocation, formConfig, children, formData } = this.props;
        const trimmedPathname = currentLocation.pathname.replace(/\/$/, '');
        const lastPathComponent = currentLocation.pathname.split('/').pop();
        const isIntroductionPage = trimmedPathname.endsWith('introduction');
    Severity: Minor
    Found in src/platform/forms-system/src/js/containers/FormApp.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 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 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 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 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 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 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 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

    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 transform has a Cognitive Complexity of 12 (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

    Function VerificationReviewWrapper has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    const VerificationReviewWrapper = ({
      children,
      dispatchUpdateToggleEnrollmentSuccess,
      dispatchVerifyEnrollmentAction,
    }) => {

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

    export const addFocusBehaviorToCrisisLineModal = () => {
      const overlay = document?.getElementById('ts-modal-crisisline');
      const modal = document?.querySelector('.vcl-crisis-panel.va-modal-inner');
    
      if (modal) {
    Severity: Minor
    Found in src/applications/proxy-rewrite/utilities/vcl-modal-behavior.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 getGroupedPreviousEnrollments has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
    Open

    export const getGroupedPreviousEnrollments = month => {
      const { transactDate, actBegin, actEnd, id, paymentDate } = month[0];
      const myUUID = uuidv4();
    
      return (
    Severity: Minor
    Found in src/applications/verify-your-enrollment/helpers.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

    Severity
    Category
    Status
    Source
    Language