department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,231 of 14,884 total issues

Function Default5103EvidenceNotice has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

function Default5103EvidenceNotice({
  decisionRequestError,
  decisionRequested,
  loadingDecisionRequest,
  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 getCalculatedBenefits has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

  (inputs, constants, institution) => {
    const avgDodBah = constants ? constants.AVGDODBAH : 0;
    const tfCap = constants ? constants.TFCAP : 0;

    const { vetTecTuitionFees, vetTecScholarships } = inputs;
Severity: Minor
Found in src/applications/gi/selectors/vetTecCalculator.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 validateAddress has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const validateAddress = (formData, fullName) => async (
  dispatch,
  getState,
) => {
  dispatch({ type: ADDRESS_VALIDATION_START });

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

const NotificationChannel = props => {
  const {
    apiStatus,
    channelId,
    channelType,

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

export const dateFormatWithoutTimezone = (
  datetime,
  format = 'MMMM d, yyyy, h:mm a',
) => {
  let withoutTimezone = datetime;
Severity: Minor
Found in src/applications/mhv-medical-records/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 blueButtonReducer has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const blueButtonReducer = (state = initialState, action) => {
  switch (action.type) {
    case Actions.BlueButtonReport.GET: {
      const updates = {};

Severity: Minor
Found in src/applications/mhv-medical-records/reducers/blueButton.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 parseMedications has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

export const parseMedications = (records, index = 7) => {
  return `
${index}) Medications

This is a list of prescriptions and other medications in your VA medical records.
Severity: Minor
Found in src/applications/mhv-medical-records/util/txtHelpers/medications.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 SelectOrganization has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring.
Open

const SelectOrganization = props => {
  const { formData, setFormData, goBack, goForward, goToPath } = props;
  const [error, setError] = useState(null);
  const organizations =
    formData['view:selectedRepresentative']?.attributes?.accreditedOrganizations

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

  render() {
    const {
      startTime,
      endTime,
      appTitle,

    Function fullNameNoSuffixUI has 39 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

    const fullNameNoSuffixUI = (formatTitle, uiOptions = {}) => {
      return {
        'ui:validations': [validateEmpty],
        first: {
          'ui:title': formatTitle ? formatTitle('first name') : 'First name',

      Function vaTextareaFieldMapping has 39 lines of code (exceeds 25 allowed). Consider refactoring.
      Open

      export default function vaTextareaFieldMapping(props) {
        const {
          description,
          textDescription,
          DescriptionField,

        Function replaceRefSchemas has 39 lines of code (exceeds 25 allowed). Consider refactoring.
        Open

        export function replaceRefSchemas(schema, definitions, path = '') {
          // this can happen if you import a field that doesn’t exist from a schema
          if (!schema) {
            throw new Error(`Schema is undefined at ${path}`);
          }
        Severity: Minor
        Found in src/platform/forms-system/src/js/state/helpers.js - About 1 hr to fix

          Function Error has 39 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

          ComboAlert.Error = () => {
            return (
              <va-alert
                class="row vads-u-margin-y--4"
                status="error"

            Function OperationStatus has 39 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            export default function OperationStatus(props) {
              const { operatingStatus, website, facilityType } = props;
              const visitText = useMemo(
                () => {
                  if (facilityType === FacilityType.VA_CEMETERY) {

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

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

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

                function phoneUISchema(category) {
                  const schema = {
                    'ui:options': {
                      hideLabelText: true,
                      showFieldLabel: false,

                  Function TaskList has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                  export const TaskList = () => {
                    const { chapterTitles, getChapterPagesFromChapterIndex } = setupPages(
                      formConfig,
                    );
                  
                  
                  Severity: Minor
                  Found in src/applications/appeals/testing/nod-new/components/TaskList.jsx - About 1 hr to fix

                    Function transform has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                    export function transform(formConfig, form) {
                      const benefitsTransform = formData => {
                        const clonedData = _.cloneDeep(formData);
                        const benefits = clonedData['view:benefit'];
                    
                    
                    Severity: Minor
                    Found in src/applications/edu-benefits/10203/submit-transformer.js - About 1 hr to fix

                      Function applicantInsuranceSOBSchema has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                      export function applicantInsuranceSOBSchema(isPrimary) {
                        const keyname = isPrimary
                          ? 'primaryInsuranceScheduleOfBenefits'
                          : 'secondaryInsuranceScheduleOfBenefits';
                        return {

                        Function isInsideListLoopReturn has 39 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                        export const isInsideListLoopReturn = (
                          chapter,
                          outerField,
                          uiTitle,
                          formChapter,
                        Severity: Minor
                        Found in src/applications/686c-674/config/helpers.js - About 1 hr to fix
                          Severity
                          Category
                          Status
                          Source
                          Language