department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function mergeRadiologyLists has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const mergeRadiologyLists = (
  phrRadiologyTestsList,
  cvixRadiologyTestsList,
) => {
  const mergedArray = [];
Severity: Minor
Found in src/applications/mhv-medical-records/reducers/labsAndTests.js - About 55 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 getLatestCopay has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const getLatestCopay = statements => {
  if (!statements) return null;
  return statements.reduce((acc, currentCopay) => {
    if (currentCopay.pSStatementDateOutput) {
      if (!acc) {
Severity: Minor
Found in src/applications/personalization/dashboard/helpers.jsx - About 55 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 mockGetRefreshStatus has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const mockGetRefreshStatus = () => {
  switch (scenario) {
    case 1: {
      return STALE;
    }
Severity: Minor
Found in src/applications/mhv-medical-records/util/testHelper.js - About 55 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 RadiologySingleImage has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

const RadiologySingleImage = () => {
  const dispatch = useDispatch();
  const { labId, imageId } = useParams();
  // const labAndTestDetails = useSelector(
  //   state => state.mr.labsAndTests.labsAndTestsDetails,
Severity: Minor
Found in src/applications/mhv-medical-records/containers/RadiologySingleImage.jsx - About 55 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 handleDataDogAction has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const handleDataDogAction = ({
  locationBasePath,
  locationChildPath,
  sendAnalytics = true,
}) => {
Severity: Minor
Found in src/applications/mhv-medical-records/util/helpers.js - About 55 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 buildMedicationInformationPDF has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export const buildMedicationInformationPDF = list => {
  const listOfHeaders = ['h2', 'h3'];
  const sections = [
    ...list
      .filter(listItem => listOfHeaders.includes(listItem.type))
Severity: Minor
Found in src/applications/mhv-medications/util/pdfConfigs.js - About 55 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 pdfTransform has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring.
Open

export function pdfTransform(formData) {
  const {
    veteranFullName,
    veteranSocialSecurityNumber: ssn,
    vaFileNumber,
Severity: Minor
Found in src/applications/representative-appoint/utilities/pdfTransform.js - About 55 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 uploadFile has 7 arguments (exceeds 4 allowed). Consider refactoring.
Open

  file,
  uiOptions,
  onProgress,
  onChange,
  onError,
Severity: Major
Found in src/platform/forms-system/src/js/actions.js - About 50 mins to fix

    Function validateMilitaryCity has 7 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      errors,
      city,
      formData,
      schema,
      messages,
    Severity: Major
    Found in src/applications/disability-benefits/all-claims/validations.js - About 50 mins to fix

      Function validateMilitaryState has 7 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        errors,
        state,
        formData,
        schema,
        messages,
      Severity: Major
      Found in src/applications/disability-benefits/all-claims/validations.js - About 50 mins to fix

        Function uiSchema has 7 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          subHeader = veteranApplicantDetailsSubHeader,
          description = '',
          nameUI = nonPreparerFullMaidenNameUI,
          ssnUI = ssnDashesUI,
          dateOfBirthUI = nonPreparerDateOfBirthUI,

          Function uiSchema has 7 arguments (exceeds 4 allowed). Consider refactoring.
          Open

            subHeader = veteranApplicantDetailsSubHeader,
            description = '',
            nameUI = nonPreparerFullMaidenNameUI,
            ssnUI = ssnDashesUI,
            dateOfBirthUI = nonPreparerDateOfBirthUI,

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

            const generateHeaderBanner = async (doc, header, data, config) => {
              doc.moveDown(1);
              const currentHeight = doc.y;
            
              // Calculate text width
            Severity: Minor
            Found in src/platform/pdf/templates/utils.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 setupJSDom has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            function setupJSDom() {
              // Prevent warnings from displaying
              /* eslint-disable no-console */
              if (process.env.LOG_LEVEL === 'debug') {
                console.error = (error, reactError) => {
            Severity: Minor
            Found in src/platform/testing/unit/mocha-setup.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 addFocusBehaviorToCrisisLineModal has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
            Open

            export default function addFocusBehaviorToCrisisLineModal() {
              const overlay = document.getElementById('modal-crisisline');
              const modal = document.querySelector('.va-crisis-panel.va-modal-inner');
              const tabbableElements = getTabbableElements(modal);
              let openControl;
            Severity: Minor
            Found in src/platform/site-wide/accessible-VCL-modal.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 (sortOrder === 'ASC') {
                    return a.attributes.recipientName.localeCompare(
                      b.attributes.recipientName,
                    );
                  }
            Severity: Major
            Found in src/platform/mhv/api/mocks/secure-messaging/threads/index.js - About 45 mins to fix

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

              export function parseStringOrDate(date) {
                if (date instanceof Date) {
                  return date;
                }
              
              
              Severity: Minor
              Found in src/platform/utilities/date/index.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 saveForm has 6 arguments (exceeds 4 allowed). Consider refactoring.
              Open

              function saveForm(saveType, formId, formData, version, returnUrl, submission) {
              Severity: Minor
              Found in src/platform/forms/save-in-progress/actions.js - About 45 mins to fix

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

                export function statementOfTruthFullName(
                  formData,
                  statementOfTruth,
                  profileFullName,
                ) {
                Severity: Minor
                Found in src/platform/forms/components/review/PreSubmitSection.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 saveFormApi has 6 arguments (exceeds 4 allowed). Consider refactoring.
                Open

                  formId,
                  formData,
                  version,
                  returnUrl,
                  savedAt,
                Severity: Minor
                Found in src/platform/forms/save-in-progress/api.js - About 45 mins to fix
                  Severity
                  Category
                  Status
                  Source
                  Language