department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,844 of 12,844 total issues

Function ConfirmationPage has 48 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export const ConfirmationPage = () => {
  resetStoredSubTask();

  return (
    <ConfirmationDecisionReviews
Severity: Minor
Found in src/applications/appeals/testing/sc/containers/ConfirmationPage.jsx - About 1 hr to fix

    Function VeteranInformation has 48 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function VeteranInformation(props) {
      const state = useFormikContext();
    
      return (
        <>
    Severity: Minor
    Found in src/applications/burial-poc-v6/pages/VeteranInformation.jsx - About 1 hr to fix

      Function render has 48 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

        render() {
          const { form } = this.props;
          const { submission, formId } = form;
      
          const appliedForVaEducationBenefits = _.get(
      Severity: Minor
      Found in src/applications/edu-benefits/0994/containers/ConfirmationPage.jsx - About 1 hr to fix

        Function mapStateToProps has 48 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export const mapStateToProps = (state, ownProps) => {
          const { fieldName } = ownProps;
        
          const { transaction, transactionRequest } = selectVAPServiceTransaction(
            state,

          Function ResultsList has 48 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          const ResultsList = props => {
            const searchResultTitle = useRef();
          
            const { inProgress, searchResults, query } = props;
          
          

            Function noDisabilityRatingContent has 48 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const noDisabilityRatingContent = errorCode => {
              let content;
              let status;
            
              if (isServerError(errorCode)) {

              Function AppContent has 48 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export default function AppContent() {
                const [data, setData] = useState({});
                const [hasError, setHasError] = useState(false);
                const [isRequestDone, setIsRequestDone] = useState(false);
              
              
              Severity: Minor
              Found in src/applications/rated-disabilities/components/AppContent.jsx - About 1 hr to fix

                Function EmergencyContact has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                const EmergencyContact = props => {
                  const { router } = props;
                  const { t } = useTranslation();
                
                  const selectVeteranData = useMemo(makeSelectVeteranData, []);

                  Function MultipleAppointmentBody has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  const MultipleAppointmentBody = props => {
                    const {
                      error,
                      appointments,
                      selectedAppointment,

                    Function TravelPayClaimFilters has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export default function TravelPayClaimFilters(props) {
                      const {
                        statusesToFilterBy,
                        checkedStatusFilters,
                        onStatusFilterChange,
                    Severity: Minor
                    Found in src/applications/travel-pay/components/TravelPayClaimFilters.jsx - About 1 hr to fix

                      Function updateFormData has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        const updateFormData = e => {
                          e.preventDefault();
                      
                          if (!isValidCurrency(grossMonthlyIncome.value)) {
                            setIncomeError(true);

                        Function captureError has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export function captureError(
                          err,
                          skipRecordEvent = false,
                          customTitle,
                          extraData,
                        Severity: Minor
                        Found in src/applications/vaos/utils/error.js - About 1 hr to fix

                          Function generateProgressNoteContent has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          export const generateProgressNoteContent = record => {
                            const content = {
                              details: {
                                header: 'Details',
                                items: [
                          Severity: Minor
                          Found in src/applications/mhv-medical-records/util/pdfHelpers/notes.js - About 1 hr to fix

                            Function DynamicRadioWidget has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            export function DynamicRadioWidget(props) {
                              const { formData, onChange } = props;
                              let organizationList = null;
                              let upperContent = null;
                              const organizations =

                              Function notQualifiedWarning has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function notQualifiedWarning() {
                                return (
                                  <div className="usa-alert usa-alert-warning usa-content not-qualified">
                                    <div className="usa-alert-body">
                                      <h2>You don't qualify</h2>
                              Severity: Minor
                              Found in src/applications/post-911-gib-status/utils/helpers.jsx - About 1 hr to fix

                                Function createRichTextDetailItem has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                const createRichTextDetailItem = async (doc, config, x, item) => {
                                  let titleText = item.title ?? '';
                                  const content = [];
                                
                                  if (titleText) {
                                Severity: Minor
                                Found in src/platform/pdf/templates/utils.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 focusElement has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export function focusElement(selectorOrElement, options = {}, root) {
                                  function applyFocus(el) {
                                    if (el) {
                                      // Use getAttribute to grab the "tabindex" attribute (returns string), not
                                      // the "tabIndex" property (returns number). Focusable elements will
                                Severity: Minor
                                Found in src/platform/utilities/ui/focus.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 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  render() {
                                    const {
                                      route,
                                      params,
                                      form,
                                Severity: Minor
                                Found in src/platform/forms-system/src/js/containers/FormPage.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 validatePages has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                                Open

                                export function validatePages(orderedPageTypes) {
                                  const pageTypes = {};
                                  for (const pageType of orderedPageTypes) {
                                    if (pageType === 'intro') {
                                      if (pageTypes.intro || pageTypes.summary || pageTypes.item) {

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

                                export const checkResponses = (formResponses, displayConditionsForPath) => {
                                  const questionRequirements = Object.keys(displayConditionsForPath);
                                
                                  for (const questionShortName of questionRequirements) {
                                    const formResponse = formResponses?.[questionShortName];
                                Severity: Minor
                                Found in src/applications/pact-act/utilities/display-logic-questions.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

                                Severity
                                Category
                                Status
                                Source
                                Language