department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function getAppeals has 44 lines of code (exceeds 25 allowed). Consider refactoring.
Open

export function getAppeals() {
  const startTimestampMs = Date.now();

  return dispatch => {
    dispatch({ type: FETCH_APPEALS_PENDING });
Severity: Minor
Found in src/applications/personalization/dashboard/actions/appeals.js - About 1 hr to fix

    Function onUpdateClicked has 44 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

      const onUpdateClicked = async () => {
        const addressState = {
          ...stateAndZip,
          state: stateAndZip.stateCode,
        };

      Function Alert has 44 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      const Alert = props => {
        const { isAlertVisible, paginatedPrescriptionsList } = props;
      
        return (
          <div className={`${isAlertVisible ? 'vads-u-margin-top--5' : ''}`}>
      Severity: Minor
      Found in src/applications/mhv-medications/components/shared/Alert.jsx - About 1 hr to fix

        Function pharmacyPhoneNumber has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const pharmacyPhoneNumber = prescription => {
          if (prescription.cmopDivisionPhone) {
            return prescription.cmopDivisionPhone;
          }
          if (prescription.dialCmopDivisionPhone) {
        Severity: Minor
        Found in src/platform/mhv/util/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 checkboxGroupUI has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const checkboxGroupUI = ({
          title,
          description,
          errorMessages,
          labels,

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

        export default function FormNav(props) {
          const {
            formConfig = {},
            currentPath,
            formData,
        Severity: Minor
        Found in src/platform/forms-system/src/js/components/FormNav.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 updateFormDataAddress has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const updateFormDataAddress = (
          oldFormData,
          formData,
          path,
          index = null, // this is included in the path, but added as

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

        export const updateFormDataAddress = (
          oldFormData,
          formData,
          path,
          index = null, // this is included in the path, but added as
        Severity: Minor
        Found in src/platform/forms-system/src/js/definitions/profileAddress.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 validatePages has a Cognitive Complexity of 14 (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 getPropertyInfo has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const getPropertyInfo = (pageList = [], name, instance = '') => {
          const findPageIndex = (
            obj,
            insideInstance = instance === '' || instance === name,
          ) => {
        Severity: Minor
        Found in src/platform/forms-system/src/js/utilities/data/reduceErrors.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 prefillTransformer has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export default function prefillTransformer(pages, formData, metadata) {
          const newFormData = formData;
        
          for (const addressType of ['permanentAddress', 'temporaryAddress']) {
            if (newFormData[addressType]?.country) {

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

        export const applyFocus = (parentId, headerHasFocused, setHeaderHasFocused) => {
          if (!headerHasFocused) {
            setTimeout(() => {
              const header = document
                .getElementById(parentId)
        Severity: Minor
        Found in src/applications/pact-act/utilities/page-setup.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 navigateBackward has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const navigateBackward = (SHORT_NAME, formResponses, router) => {
          const roadmap = makeRoadmap(getServicePeriodResponse(formResponses));
        
          if (roadmap?.length) {
            const CURRENT_INDEX = roadmap?.indexOf(SHORT_NAME);
        Severity: Minor
        Found in src/applications/pact-act/utilities/page-navigation.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 InformalConferenceContact has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const InformalConferenceContact = ({
          data,
          goBack,
          goForward,
          onReviewPage,

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

        const BenefitRelinquishWidget = ({ formData, setFormData }) => {
          const { eligibility } = formData;
          const [selected, setSelected] = useState('');
        
          const chapter30 = eligibility?.includes('Chapter30');

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

        export const getEvidence = formData => {
          const evidenceSubmission = {
            evidenceType: [],
          };
          const showNewFormContent = showScNewForm(formData);
        Severity: Minor
        Found in src/applications/appeals/995/utils/submit.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 applyFocus has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const applyFocus = (parentId, headerHasFocused, setHeaderHasFocused) => {
          if (!headerHasFocused) {
            setTimeout(() => {
              const header = document
                .getElementById(parentId)
        Severity: Minor
        Found in src/applications/discharge-wizard/utilities/page-setup.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 transform has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export function transform(formConfig, form) {
          const usFormTransform = () =>
            JSON.parse(transformForSubmit(formConfig, form));
        
          const prefillTransforms = formData => {
        Severity: Minor
        Found in src/applications/edu-benefits/0994/submit-transformer.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 SearchForm has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export const SearchForm = ({ fetchForms }) => {
          const query = new URLSearchParams(window.location.search).get('q') ?? '';
          const [queryState, setQueryState] = useState(query);
          const [showQueryError, setShowQueryError] = useState(false);
        
        
        Severity: Minor
        Found in src/applications/find-forms/containers/SearchForm.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 transform has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
        Open

        export function transform(formConfig, form) {
          const newSchoolTransform = formData => {
            let clonedData = _.cloneDeep(formData);
            delete clonedData.newSchoolName;
            delete clonedData.newSchoolAddress;
        Severity: Minor
        Found in src/applications/edu-benefits/1995/config/submit-transformer.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