department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,762 of 12,762 total issues

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

export const getLongTermAppointmentHistoryV2 = ((chunks = 1) => {
  const batch = [];
  let promise = null;

  return () => {
Severity: Minor
Found in src/applications/vaos/services/appointment/index.js - About 1 hr to fix

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

                      export default async function sendNextStepsEmail(body) {
                        const apiSettings = {
                          mode: 'cors',
                          method: 'POST',
                          headers: {
                      Severity: Minor
                      Found in src/applications/representative-appoint/api/sendNextStepsEmail.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 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 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 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 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 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 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

                        Severity
                        Category
                        Status
                        Source
                        Language