department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,732 of 12,811 total issues

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

          render() {
            const {
              chapters,
              form,
              formConfig,
        Severity: Minor
        Found in src/platform/forms-system/src/js/review/ReviewChapters.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 convertNextValueToCleanData has 35 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

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

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

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

                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 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

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

                        export function transform(formConfig, form) {
                          // https://dev-developer.va.gov/explore/appeals/docs/decision_reviews?version=current
                          const mainTransform = formData => {
                            const informalConference = formData.informalConference !== 'no';
                            const attributes = {
                        Severity: Minor
                        Found in src/applications/appeals/testing/hlr/config/submit-transformer.js - About 1 hr to fix

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

                          export const getContestableIssues = props => {
                            const benefitType = props?.benefitType || DEFAULT_BENEFIT_TYPE;
                            return dispatch => {
                              dispatch({ type: FETCH_CONTESTABLE_ISSUES_INIT });
                          
                          
                          Severity: Minor
                          Found in src/applications/appeals/995/actions/index.js - About 1 hr to fix

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

                            export const getContestableIssues = props => {
                              const benefitType = props?.benefitType || DEFAULT_BENEFIT_TYPE;
                              return dispatch => {
                                dispatch({ type: FETCH_CONTESTABLE_ISSUES_INIT });
                            
                            
                            Severity: Minor
                            Found in src/applications/appeals/testing/hlr/actions/index.js - About 1 hr to fix
                              Severity
                              Category
                              Status
                              Source
                              Language