department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,736 of 12,833 total issues

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 handleScroll has 32 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        () => {
          if (
            !initialTop &&
            headerRef.current &&
            headerRef.current.offsetTop &&
    Severity: Minor
    Found in src/applications/gi/containers/ComparePage.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 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 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 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 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 TextWidget has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              export default function TextWidget(props) {
                let inputType = props.options.inputType;
                if (!inputType) {
                  inputType = numberTypes.has(props.schema.type) ? 'number' : props.type;
                }
              Severity: Minor
              Found in src/platform/forms-system/src/js/widgets/TextWidget.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 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 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 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 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

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

              export default function OtherTextField(props) {
                let { inputType } = props.options;
                if (!inputType) {
                  inputType = numberTypes.has(props.schema.type) ? 'number' : props.type;
                }
              Severity: Minor
              Found in src/platform/user/profile/vap-svc/components/OtherTextField.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 CheckboxGroup has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

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

              const DebtLettersSummary = () => {
                const { debtLetters, mcp } = useSelector(
                  ({ combinedPortal }) => combinedPortal,
                );
                const showDebtLetterDownload = useSelector(state =>

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

              export const fetchLocations = async (
                address = null,
                bounds,
                locationType,
                serviceType,

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

              const submit = form => {
                const currentAddress = form.data['view:currentAddress'];
                const itemQuantities = form.data?.order?.length;
                const { order, permanentAddress, temporaryAddress, vetEmail } = form.data;
                for (const address of [permanentAddress, temporaryAddress]) {
              Severity: Minor
              Found in src/applications/health-care-supply-reordering/config/form.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 PrimaryPhone has a Cognitive Complexity of 11 (exceeds 5 allowed). Consider refactoring.
              Open

              export const PrimaryPhone = ({
                data,
                goBack,
                goForward,
                onReviewPage,
              Severity: Minor
              Found in src/applications/appeals/995/components/PrimaryPhone.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