department-of-veterans-affairs/vets-website

View on GitHub

Showing 12,848 of 12,848 total issues

Function getDaysOfTheWeek has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

function getDaysOfTheWeek(momentDate, showWeekend) {
  const daysToShow = [];
  let dayOfWeek;

  if (!showWeekend) {
Severity: Minor
Found in src/applications/vaos/components/calendar/CalendarWidget.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 CCLayout has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export default function CCLayout({ data: appointment }) {
  const {
    comment,
    facility,
    isPastAppointment,
Severity: Minor
Found in src/applications/vaos/components/layout/CCLayout.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 RequestedAppointmentDetailsPage has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export default function RequestedAppointmentDetailsPage() {
  const { id } = useParams();
  const dispatch = useDispatch();

  useEffect(

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

export default function PhoneLayout({ data: appointment }) {
  const {
    clinicName,
    clinicPhone,
    clinicPhoneExtension,
Severity: Minor
Found in src/applications/vaos/components/layout/PhoneLayout.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 ClaimExamLayout has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export default function ClaimExamLayout({ data: appointment }) {
  const {
    clinicName,
    clinicPhysicalLocation,
    clinicPhone,
Severity: Minor
Found in src/applications/vaos/components/layout/ClaimExamLayout.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 AccordionItem has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export default function AccordionItem({
  button,
  children,
  expanded = true,
  headerClass,
Severity: Minor
Found in src/applications/gi/components/AccordionItem.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 compareAddressObjects has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export function compareAddressObjects(obj1, obj2) {
  const { hasOwnProperty } = Object.prototype;

  const keys1 = Object.keys(obj1);
  const keys2 = Object.keys(obj2);

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

export function makeUserObject(options = {}) {
  const services = options.services || ['vet360'];
  let claims = {
    ch33_bank_accounts: true,
    communication_preferences: true,
Severity: Minor
Found in src/applications/personalization/common/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 UpdateErrorAlert has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring.
Open

export const UpdateErrorAlert = ({ className, saveError }) => {
  const alertRef = React.useRef();

  useEffect(
    () => {

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

const Appeal = ({ appeal, name }) => {
  if (!appeal.attributes) {
    throw new TypeError(
      '`appeal` prop is malformed; it should have an `attributes` property.',
    );

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

  render() {
    const { customText } = this.props;

    const appType = customText?.appType || APP_TYPE_DEFAULT;

    Function scheduledDowntime has 35 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    export default function scheduledDowntime(state = initialState, action) {
      switch (action.type) {
        case RECEIVE_GLOBAL_DOWNTIME:
          return {
            ...state,
    Severity: Minor
    Found in src/platform/monitoring/DowntimeNotification/reducer/index.js - About 1 hr to fix

      Function asyncLoader has 35 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function asyncLoader(getComponent, message) {
        return class AsyncComponent extends React.Component {
          static Component = null;
      
          constructor(props) {
      Severity: Minor
      Found in src/platform/utilities/ui/asyncLoader.jsx - About 1 hr to fix

        Function updateValidationKeyAndSave has 35 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        ) => async dispatch => {
          dispatch({
            type: ADDRESS_VALIDATION_UPDATE,
            fieldName,
          });
        Severity: Minor
        Found in src/platform/user/profile/vap-svc/actions/transactions.js - About 1 hr to fix

          Function createExternalApplicationUrl has 35 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          export const createExternalApplicationUrl = () => {
            const { application, to } = getQueryParams();
            if (!application) {
              return null;
            }
          Severity: Minor
          Found in src/platform/user/authentication/utilities.js - About 1 hr to fix

            Function addressConvertNextValueToCleanData has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            const addressConvertNextValueToCleanData = value => {
              const {
                id,
                addressLine1,
                addressLine2,

              Function convertNextValueToCleanData has 35 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

              export const convertNextValueToCleanData = value => {
                const {
                  id,
                  addressLine1,
                  addressLine2,

                Function phoneUISchema has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                export function phoneUISchema(category) {
                  return {
                    'ui:options': {
                      hideLabelText: true,
                      showFieldLabel: false,
                Severity: Minor
                Found in src/applications/fry-dea/schema.js - About 1 hr to fix

                  Function Zero has 35 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  ComboAlert.Zero = () => {
                    return (
                      <va-alert
                        class="row vads-u-margin-bottom--5"
                        status="info"

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

                      render() {
                        const { facility, currentQuery, showHoursSpecialInstructions } = this.props;
                    
                        if (!facility) {
                          return null;
                    Severity: Minor
                    Found in src/applications/facility-locator/containers/FacilityDetail.jsx - About 1 hr to fix
                      Severity
                      Category
                      Status
                      Source
                      Language