department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,841 of 12,841 total issues

Function CompareDrawer has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export function CompareDrawer({
  compare,
  dispatchRemoveCompareInstitution,
  displayed,
  alwaysDisplay = false,
Severity: Minor
Found in src/applications/gi/containers/CompareDrawer.jsx - About 2 hrs 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 SearchPage has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export function SearchPage({
  dispatchChangeSearchTab,
  search,
  preview,
  filters,
Severity: Minor
Found in src/applications/gi/containers/SearchPage.jsx - About 2 hrs 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 careSummariesAndNotesReducer has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

export const careSummariesAndNotesReducer = (state = initialState, action) => {
  switch (action.type) {
    case Actions.CareSummariesAndNotes.GET: {
      return {
        ...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 App has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

const App = ({ children }) => {
  const user = useSelector(selectUser);
  const userServices = user.profile.services;
  const hasMhvAccount = user.profile.mhvAccountState !== 'NONE';

Severity: Minor
Found in src/applications/mhv-medical-records/containers/App.jsx - About 2 hrs 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 AllergiesPrintOnly has a Cognitive Complexity of 16 (exceeds 5 allowed). Consider refactoring.
Open

const AllergiesPrintOnly = props => {
  const { allergies } = props;

  const content = () => {
    return (

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

  render() {
    const { renderChildItems } = this;
    const { navItemsLookup } = this.props;

    // Derive the parent-most nav item. This is O(n), which isn't great but I'm assuming there won't be 1000s of side nav items.
Severity: Major
Found in src/platform/site-wide/side-nav/components/SideNav.js - About 2 hrs to fix

    Function renderVerifiedContent has 52 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const renderVerifiedContent = () => {
        if (shouldVerify()) {
          return (
            <va-loading-indicator set-focus message="Redirecting to verify..." />
          );
    Severity: Major
    Found in src/platform/user/authorization/components/RequiredLoginView.jsx - About 2 hrs to fix

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

      const mapStateToProps = state => {
        const { featureToggles } = state;
        const selectedAddress = state.form?.data['view:currentAddress'];
        const shippingAddress = state.form?.data[selectedAddress];
        const { fullName, vetEmail, order, supplies } = state.form?.data;

        Function submitForm has 52 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        const submitForm = (form, formConfig) => {
          const body = formConfig.transformForSubmit(formConfig, form);
        
          const formData = form.data;
          const uiSchema = formConfig.chapters.chapter1.pages.page1.uiSchema;
        Severity: Major
        Found in src/applications/coronavirus-research/sign-up/config/submitForm.js - About 2 hrs to fix

          Function EnrollmentVerificationBreadcrumbs has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export default function EnrollmentVerificationBreadcrumbs() {
            const breadcrumbsArray = [
              {
                href: '/',
                label: 'Home',

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

              render() {
                const {
                  setReferredBenefit,
                  setWizardStatus,
                  expander,
            Severity: Major
            Found in src/applications/static-pages/wizard/index.js - About 2 hrs to fix

              Function createRoutesWithStore has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              const createRoutesWithStore = () => {
                return (
                  <Switch>
                    {routes.map((route, i) => {
                      const options = { appName: APP_NAMES.PRE_CHECK_IN };
              Severity: Major
              Found in src/applications/check-in/pre-check-in/routes.jsx - About 2 hrs to fix

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

                const mapStateToProps = state => {
                  const { featureToggles } = state;
                  const selectedAddress = state.form?.data['view:currentAddress'];
                  const shippingAddress = state.form?.data[selectedAddress];
                  const { fullName, vetEmail, order, supplies } = state.form?.data;

                  Function createPageListByChapterAskVa has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export function createPageListByChapterAskVa(formConfig, pagesToMoveConfig) {
                    const pagesByChapter = {};
                    const modifiedFormConfig = {
                      chapters: {},
                    };
                  Severity: Major
                  Found in src/applications/ask-va/utils/reviewPageHelper.js - About 2 hrs to fix

                    Function updateSchema has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                          updateSchema: (formData, formSchema) => {
                            const updatedCategoryTopicContactPreferences = getContactMethods(
                              formData.category,
                              formData.topic,
                            );

                      Function getMonthlyIncome has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      const getMonthlyIncome = formData => {
                        const {
                          additionalIncome: {
                            addlIncRecords = [],
                            spouse: { spAddlIncome = [] } = {},
                      Severity: Major
                      Found in src/applications/financial-status-report/utils/calculateIncome.js - About 2 hrs to fix

                        Function calculateIncome has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        const calculateIncome = (
                          enhancedFSRActive,
                          employmentRecords = [],
                          currEmployment = [],
                          addlIncRecords = [],
                        Severity: Major
                        Found in src/applications/financial-status-report/utils/calculateIncome.js - About 2 hrs to fix

                          Function OrientationApp has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                          const OrientationApp = props => {
                            const [step, setStep] = useState(0);
                            const [isFirstRender, setIsFirstRender] = useState(true);
                            const { wizardStateHandler } = props;
                          
                          
                          Severity: Major
                          Found in src/applications/vre/28-1900/orientation/OrientationApp.jsx - About 2 hrs to fix

                            Function InnerNavigation has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                            const InnerNavigation = () => {
                              const location = useLocation();
                            
                              const handleActiveLinksStyle = path => {
                                let isInnerActive = false;
                            Severity: Major
                            Found in src/applications/mhv-secure-messaging/components/InnerNavigation.jsx - About 2 hrs to fix

                              Function confirmAppointment has 52 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function confirmAppointment(history) {
                                return async (dispatch, getState) => {
                                  const featureBreadcrumbUrlUpdate = selectFeatureBreadcrumbUrlUpdate(
                                    getState(),
                                  );
                              Severity: Major
                              Found in src/applications/vaos/covid-19-vaccine/redux/actions.js - About 2 hrs to fix
                                Severity
                                Category
                                Status
                                Source
                                Language