department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function generateResultsContent has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const generateResultsContent = async (doc, parent, data) => {
  const results = doc.struct('Sect', {
    title: 'Results',
  });
  parent.add(results);
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 generateResultsContent has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

const generateResultsContent = async (doc, parent, data) => {
  for (const resultItem of data.results) {
    const results = doc.struct('Sect', {
      title: resultItem.header || 'Results',
    });
Severity: Minor
Found in src/platform/pdf/templates/medications.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 SipsDevModal has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

const SipsDevModal = props => {
  const { pageList, form, locationPathname } = props || {};
  const { formId, version, data, submission } = form || {};

  const [isModalVisible, toggleModal] = useState(false);
Severity: Minor
Found in src/platform/forms/save-in-progress/SaveInProgressDevModal.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 formatAddress has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export function formatAddress(address) {
  /* eslint-disable prefer-template */

  const {
    addressLine1,
Severity: Minor
Found in src/platform/forms/address/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 FormApp has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

const FormApp = props => {
  const { currentLocation, formConfig, children, formData } = props;
  const trimmedPathname = currentLocation.pathname.replace(/\/$/, '');
  const lastPathComponent = currentLocation.pathname.split('/').pop();
  const { additionalRoutes, CustomTopContent } = formConfig;
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 extractProfileErrors has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const extractProfileErrors = dataPayload => {
  const metaDescriptions = dataPayload?.meta?.errors?.reduce(
    (acc, error, index) =>
      error?.description
        ? `${acc}${index > 0 ? ' | ' : ''}${error.description}`
Severity: Minor
Found in src/platform/user/profile/actions/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 TernaryRadios has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

const TernaryRadios = ({
  formError,
  formResponses,
  formValue,
  h1,
Severity: Minor
Found in src/applications/pact-act/containers/questions/TernaryRadios.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 PaymentHistoryTable has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

const PaymentHistoryTable = ({ currentDebt }) => {
  const getFirstPaymentDateFromCurrentDebt = debt => {
    const firstPaymentDate = last(debt.fiscalTransactionData)?.transactionDate;

    if (firstPaymentDate === '') return 'N/A';

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

export const getDynamicContent = formResponses => {
  // Final content to show on the results page
  const dynamicContentMatchingAnswer = [];

  // Get array of short names with responses in the store minus SERVICE_PERIOD and any question ending in '_A'
Severity: Minor
Found in src/applications/pact-act/utilities/results-1-1-dynamic-content.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 OverviewPage has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

const OverviewPage = () => {
  const { debtLetters, mcp } = useSelector(
    ({ combinedPortal }) => combinedPortal,
  );
  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 useServiceType has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export default function useServiceType() {
  const dispatch = useDispatch();

  const selector = useSelector(
    state => state.drupalStaticData.vaHealthServicesData || [],
Severity: Minor
Found in src/applications/facility-locator/hooks/useServiceType.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 CustomEmailField has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function CustomEmailField(props) {
  function handleChange(event) {
    if (props?.showMebEnhancements08) {
      if (props.email !== event) {
        props.setFormData({

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

function IntroductionLogin({
  isClaimantCallComplete,
  isPersonalInfoFetchFailed,
  isLoggedIn,
  isLOA3,

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

const Results = ({ dependents, pastMode, results, router, year, zipCode }) => {
  const APPLY_URL = '/health-care/apply-for-health-care-form-10-10ez/';
  const currentYear = new Date().getFullYear();

  useEffect(
Severity: Minor
Found in src/applications/income-limits/containers/ResultsPage.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 uiSchema has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export function uiSchema(
  label = 'Address',
  useStreet2 = true,
  useStreet3 = false,
  isRequired = null,

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

function createMutationObserverCallback() {
  // Find native header, footer, etc based on page path
  const DEPRECATED_SELECTOR_CONFIG = [
    {
      path: /.*/,
Severity: Minor
Found in src/applications/proxy-rewrite/proxy-rewrite-entry.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 validateAddress has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const validateAddress = (formData, fullName) => async (
  dispatch,
  getState,
) => {
  dispatch({ type: ADDRESS_VALIDATION_START });
Severity: Minor
Found in src/applications/verify-your-enrollment/actions/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 VerificationReviewWrapper has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

const VerificationReviewWrapper = ({
  children,
  dispatchUpdateToggleEnrollmentSuccess,
  dispatchVerifyEnrollmentAction,
  enrollmentVerifications,

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

const App = ({
  canApply,
  certificateOfEligibility: { coe, generateAutoCoeStatus, profileIsUpdating },
  getCoe,
  getCoeMock,

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

export function libraryFilters(el) {
  // Grab our current page from the active pager button.
  if (el.srcElement.classList.contains('pager-numbers')) {
    activePage = parseInt(el.srcElement.text, 10);
    sessionStorage.setItem('pageNum', parseInt(el.srcElement.text, 10));

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