department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function EvidencePrivateRequest has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const EvidencePrivateRequest = ({
  data = {},
  goBack,
  goForward,
  goToPath,

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

export const PrivateContent = ({
  list = [],
  limitedConsent = '',
  reviewMode = false,
  onReviewPage,
Severity: Minor
Found in src/applications/appeals/testing/sc/components/EvidenceSummaryLists.jsx - About 45 mins 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 PrivateContent has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

export const PrivateContent = ({
  list = [],
  limitedConsent = '',
  reviewMode = false,
  onReviewPage,
Severity: Minor
Found in src/applications/appeals/995/components/EvidenceSummaryLists.jsx - About 45 mins 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 EvidencePrivateRequest has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
Open

const EvidencePrivateRequest = ({
  data = {},
  goBack,
  goForward,
  goToPath,

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

export const parseDateToDateObj = (date, template) => {
  let newDate = date;
  if (typeof date === 'string') {
    if (date.includes('T')) {
      newDate = parseISO((date || '').split('T')[0]);
Severity: Minor
Found in src/applications/appeals/shared/utils/dates.js - About 45 mins 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

Avoid deeply nested control flow statements.
Open

        } else if (
          displayConditionsMet(nextShortName, formResponses) &&
          !editMode
        ) {
          if (routeMap[routeMap.length - 1] !== ROUTES?.[nextShortName]) {
Severity: Major
Found in src/applications/discharge-wizard/utilities/page-navigation.js - About 45 mins to fix

    Function submitForm has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
    Open

    const submitForm = (form, formConfig) => {
      const body = formConfig.transformForSubmit(formConfig, form);
    
      const formData = form.data;
      const uiSchema = formConfig.chapters.chapter1.pages.page1.uiSchema;
    Severity: Minor
    Found in src/applications/coronavirus-research/sign-up/config/submitForm.js - About 45 mins 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

    Avoid deeply nested control flow statements.
    Open

              if (routeMap[routeMap.length - 1] !== ROUTES?.[nextShortName]) {
                if (valueHasChanged) {
                  const index = routeMap.indexOf(ROUTES[SHORT_NAME]);
                  const newRouteMap = routeMap.slice(0, index + 1);
                  setRouteMap([...newRouteMap, ROUTES?.[nextShortName]]);
    Severity: Major
    Found in src/applications/discharge-wizard/utilities/page-navigation.js - About 45 mins to fix

      Function StepTwo has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
      Open

      const StepTwo = ({ formResponses }) => {
        if (
          formResponses[SHORT_NAME_MAP.REASON] ===
          RESPONSES.REASON_DD215_UPDATE_TO_DD214
        ) {

      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

      Avoid deeply nested control flow statements.
      Open

                if (formResponses[nextShortName]) {
                  localRoadMap.push(ROUTES?.[nextShortName]);
                }
      Severity: Major
      Found in src/applications/discharge-wizard/utilities/page-navigation.js - About 45 mins to fix

        Function ContestableIssuesLegend has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export const ContestableIssuesLegend = ({ onReviewPage, inReviewMode }) => {
          let Wrap = 'h3';
          const wrapClassNames = ['vads-u-font-size--h3'];
          if (onReviewPage) {
            // Using a div in review mode, see
        Severity: Minor
        Found in src/applications/appeals/shared/content/contestableIssues.jsx - About 45 mins 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 StepOne has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        const StepOne = ({ formValues }) => {
          if (formValues['4_reason'] === '8') {
            return null;
          }
        
        
        Severity: Minor
        Found in src/applications/discharge-wizard/components/gpSteps/StepTwo.jsx - About 45 mins 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 YearPage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        const YearPage = ({
          editMode,
          pastMode,
          router,
          toggleEditMode,
        Severity: Minor
        Found in src/applications/income-limits/containers/YearPage.jsx - About 45 mins 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 DependentInformation has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        const DependentInformation = props => {
          const { data, goToPath, setFormData } = props;
        
          const { dependents = [] } = data;
          const search = new URLSearchParams(window.location.search);
        Severity: Minor
        Found in src/applications/ezr/components/FormPages/DependentInformation.jsx - About 45 mins 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 submitTransformer has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export function submitTransformer(formConfig, form) {
          const { data: formData, loadedData } = form;
          const expandedPages = expandArrayPages(
            createFormPageList(formConfig),
            formData,
        Severity: Minor
        Found in src/applications/ezr/utils/helpers/submit-transformer.js - About 45 mins 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 8 (exceeds 5 allowed). Consider refactoring.
        Open

          render() {
            const {
              newBenefit,
              serviceBenefitBasedOn,
              transferredEduBenefits,
        Severity: Minor
        Found in src/applications/edu-benefits/components/EducationWizard.jsx - About 45 mins 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 ApplicantRelationshipReviewPage has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export function ApplicantRelationshipReviewPage(props) {
          const { data, keyname = KEYNAME, primary = PRIMARY, secondary = SECONDARY } =
            props || {};
          const genOps = props.genOp || generateOptions;
          const {

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

        const Search = ({ isDesktop, searchIsOpen }) => {
          const [inputValue, setInputValue] = useState('');
          const searchInput = document.getElementById(
            'search-header-dropdown-input-field',
          );
        Severity: Minor
        Found in src/applications/proxy-rewrite/partials/search.jsx - About 45 mins 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 transformForSubmit has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function transformForSubmit(formConfig, form) {
          const transformedData = JSON.parse(
            formsSystemTransformForSubmit(formConfig, form),
          );
        
        
        Severity: Minor
        Found in src/applications/ivc-champva/10-10D/config/submitTransformer.js - About 45 mins 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 validateDocumentDescription has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
        Open

        export const validateDocumentDescription = (errors, fileList) => {
          fileList.forEach((file, index) => {
            const error =
              file.attachmentType === 'Other' && !file.attachmentDescription
                ? 'Provide a description'
        Severity: Minor
        Found in src/applications/lgy/coe/form/validations.js - About 45 mins 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