department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function renderOptions has 32 lines of code (exceeds 25 allowed). Consider refactoring.
Open

  const renderOptions = () => {
    const displayOptions = Array.isArray(options) ? options : [];
    return displayOptions.map((option, index) => {
      const { checked, optionLabel, name, learnMore, dataTestId } = option;
      return (
Severity: Minor
Found in src/applications/gi/components/CheckboxGroup.jsx - About 1 hr to fix

    Function fieldLabel has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const fieldLabel = (field, index, displayDiff) => {
        return (
          <div
            role="rowheader"
            key={`${index}-label`}
    Severity: Minor
    Found in src/applications/gi/components/CompareGrid.jsx - About 1 hr to fix

      Function default has 32 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function(state = INITIAL_STATE, action) {
        switch (action.type) {
          case FETCH_PROFILE_STARTED:
            return {
              ...state,
      Severity: Minor
      Found in src/applications/gi/reducers/profile.js - About 1 hr to fix

        Function createRow has 32 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

          const createRow = (inst, type, name = inst.institution) => {
            const estimatedHousing = (
              <div key="months">
                {estimatedHousingValue(inst)}
                <span className="sr-only">per month</span>
        Severity: Minor
        Found in src/applications/gi/components/profile/SchoolLocations.jsx - About 1 hr to fix

          Function SizeOfInstitutionsModalContent has 32 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function SizeOfInstitutionsModalContent() {
            return (
              <>
                <p>
                  The size of institutions is based on calculation of full-time equivalent

            Function Disclaimer has 32 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function Disclaimer() {
              return (
                <div className="row disclaimer">
                  <p>
                    Please note: Content on this Web page is for informational purposes
            Severity: Minor
            Found in src/applications/gi/components/content/Disclaimer.jsx - About 1 hr to fix

              Function bankInfo has 32 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const bankInfo = (state = initialState, action) => {
                switch (action.type) {
                  case UPDATE_BANK_INFO:
                    return {
                      ...state,

                Function ContactInfoNeeded has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export const ContactInfoNeeded = () => {
                  const email = useSelector(state =>
                    selectVAPContactInfoField(state, FIELD_NAMES.EMAIL),
                  );
                  const mailingAddress = useSelector(state =>

                  Function handleCheckAll has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    const handleCheckAll = () => {
                      setSelectionError(null);
                  
                      const newCheckAll = !checkAll;
                      setCheckAll(newCheckAll);

                    Function ReplaceAccreditedRepresentative has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    const ReplaceAccreditedRepresentative = props => {
                      const { formData } = props;
                      const currentRep = formData?.['view:representativeStatus'] || {};
                      const selectedRepAttributes =
                        formData?.['view:selectedRepresentative']?.attributes || {};

                      Function generateChemHemTxt has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const generateChemHemTxt = async () => {
                          setDownloadStarted(true);
                          const content = `\n
                      ${crisisLineHeader}\n\n
                      ${record.name}\n

                        Function getRecordType has 32 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const getRecordType = record => {
                          if (record.resourceType === fhirResourceTypes.DIAGNOSTIC_REPORT) {
                            if (record.code?.text === 'CH') return labTypes.CHEM_HEM;
                            if (
                              record.code?.coding?.some(
                        Severity: Minor
                        Found in src/applications/mhv-medical-records/reducers/labsAndTests.js - About 1 hr to fix

                          Function viewportPresetHelper has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const viewportPresetHelper = (preset, orientation, options) => {
                            if (
                              isValidPreset(preset) &&
                              isValidOrientation(orientation) &&
                              isValidOptions(options)
                          Severity: Minor
                          Found in src/platform/testing/e2e/cypress/support/commands/viewportPreset.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 FlipperClient has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function FlipperClient({
                            host = 'http://localhost:3000',
                            toggleValuesPath = TOGGLE_VALUES_PATH,
                          } = {}) {
                            let _timeoutId;
                          Severity: Minor
                          Found in src/platform/utilities/feature-toggles/flipper-client.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 getInput has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function getInput(input, uiSchema, schema) {
                            if (input && input.widget === 'autosuggest') {
                              return input.label;
                            }
                          
                          
                          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 ContactInfoReview has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                          const ContactInfoReview = ({
                            data,
                            editPage,
                            content,
                            keys,
                          Severity: Minor
                          Found in src/platform/forms-system/src/js/components/ContactInfoReview.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 validateNoSchemaAssociatedWithLinkOrButton has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                          function validateNoSchemaAssociatedWithLinkOrButton(
                            pageConfig,
                            useLinkInsteadOfYesNo,
                            useButtonInsteadOfYesNo,
                          ) {

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

                          export default function ArrayBuilderItemPage({
                            arrayPath,
                            summaryRoute,
                            introRoute,
                            reviewRoute,

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

                          export function updateItemsSchema(schema, fieldData = null) {
                            if (schema.type === 'array') {
                              let newSchema = schema;
                          
                              // This happens the first time this function is called when
                          Severity: Minor
                          Found in src/platform/forms-system/src/js/state/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 render has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
                          Open

                            render() {
                              const {
                                accountLevel,
                                accountState,
                                errors,
                          Severity: Minor
                          Found in src/platform/user/authorization/containers/MHVApp.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