department-of-veterans-affairs/vets-website

View on GitHub

Showing 4,177 of 14,709 total issues

Function makeAuthRequest has 5 arguments (exceeds 4 allowed). Consider refactoring.
Open

  url,
  userOptions,
  dispatch,
  onSuccess,
  onError,
Severity: Minor
Found in src/applications/claims-status/utils/helpers.js - About 35 mins to fix

    Function getAppointments has 5 arguments (exceeds 4 allowed). Consider refactoring.
    Open

      start,
      end,
      statuses = [],
      avs = false,
      fetchClaimStatus = false,
    Severity: Minor
    Found in src/applications/vaos/services/vaos/index.js - About 35 mins to fix

      Function fetchSearchByLocationCoords has 5 arguments (exceeds 4 allowed). Consider refactoring.
      Open

        location,
        coordinates,
        distance,
        filters,
        version,
      Severity: Minor
      Found in src/applications/gi/actions/index.js - About 35 mins to fix

        Function aboutTheSchoolOptions has 5 arguments (exceeds 4 allowed). Consider refactoring.
        Open

          excludeCautionFlags,
          accredited,
          studentVeteran,
          yellowRibbonScholarship,
          automatedTest = false,
        Severity: Minor
        Found in src/applications/gi/containers/search/FilterBeforeResults.jsx - About 35 mins to fix

          Function getRenderToken has 5 arguments (exceeds 4 allowed). Consider refactoring.
          Open

          export function getRenderToken(tokens, idx, options, env, self) {
          Severity: Minor
          Found in src/applications/virtual-agent/utils/markdownRenderer.js - About 35 mins to fix

            Function uiSchema has 5 arguments (exceeds 4 allowed). Consider refactoring.
            Open

              subHeader = nonVeteranApplicantDetailsSubHeader,
              description = nonVeteranApplicantDetailsDescription,
              nameUI = nonPreparerFullMaidenNameUI,
              ssnUI = ssnDashesUI,
              dateOfBirthUI = nonPreparerDateOfBirthUI,

              Function uiSchema has 5 arguments (exceeds 4 allowed). Consider refactoring.
              Open

                subHeader = nonVeteranApplicantDetailsSubHeader,
                description = nonVeteranApplicantDetailsDescription,
                nameUI = nonPreparerFullMaidenNameUI,
                ssnUI = ssnDashesUI,
                dateOfBirthUI = nonPreparerDateOfBirthUI,

                Function createDetailItem has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                const createDetailItem = async (doc, config, x, item) => {
                  const paragraphOptions = { lineGap: item.lineGap ?? 6 };
                  let titleText = item.title ?? '';
                  const content = [];
                  const monospaceFont = config.text.monospaceFont || config.text.font;
                Severity: Minor
                Found in src/platform/pdf/templates/utils.js - About 35 mins 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 generate has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                const generate = async data => {
                  validate(data.details);
                
                  const doc = createAccessibleDoc(data, config);
                
                
                Severity: Minor
                Found in src/platform/pdf/templates/veteran_status_new.js - About 35 mins 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 formatMenuItems has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export const formatMenuItems = menuItems => {
                  const formattedMenuItems = [];
                
                  if (menuItems && isArray(menuItems)) {
                    return menuItems;
                Severity: Minor
                Found in src/platform/site-wide/header/helpers/index.js - About 35 mins 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 getAccordionParents has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                const getAccordionParents = elem => {
                  // Setup parents array
                  const parents = [];
                
                  // Get matching parent elements
                Severity: Minor
                Found in src/platform/site-wide/legacy-component-js/accordion.js - About 35 mins 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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  render() {
                    const { customText } = this.props;
                
                    const appType = customText?.appType || APP_TYPE_DEFAULT;
                
                

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

                const generateFooterContent = async (
                  doc,
                  parent,
                  data,
                  config,
                Severity: Minor
                Found in src/platform/pdf/templates/utils.js - About 35 mins 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 normalizeAndCategorizeFacility has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                const normalizeAndCategorizeFacility = (
                  collection = {},
                  facilityEntity = [],
                  includeCernerStaged = [],
                ) => {

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

                const Column = props => {
                  const {
                    mobileMediaQuery,
                    data,
                    keyName,
                Severity: Minor
                Found in src/platform/site-wide/mega-menu/components/Column.jsx - About 35 mins 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 OfficialGovtWebsite has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export const OfficialGovtWebsite = () => {
                  const [expanded, setExpanded] = useState(false);
                
                  const onToggle = () => {
                    if (expanded) {
                Severity: Minor
                Found in src/platform/site-wide/header/components/OfficialGovtWebsite/index.js - About 35 mins 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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  render() {
                    const { currentLocation, formConfig, children, loadedStatus } = this.props;
                    const appType = formConfig?.customText?.appType || APP_TYPE_DEFAULT;
                    const trimmedPathname = currentLocation.pathname.replace(/\/$/, '');
                    let content;
                Severity: Minor
                Found in src/platform/forms/save-in-progress/RoutedSavableApp.jsx - About 35 mins 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 redirectOrLoad has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                  redirectOrLoad(props) {
                    // Stop a user that's been redirected from being redirected again after
                    // logging in
                    this.shouldRedirectOrLoad = false;
                
                
                Severity: Minor
                Found in src/platform/forms/save-in-progress/RoutedSavableApp.jsx - About 35 mins 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 withEditTitle has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
                Open

                export const withEditTitle = (title, lowerCase = true) => {
                  return props => {
                    const search = getArrayUrlSearchParams();
                    const isEdit = search.get('edit');
                    const titleStr = typeof title === 'function' ? title(props) : title;

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

                module.exports = function titleCase(string) {
                  return string
                    .split(wordSeparators)
                    .map((current, index, array) => {
                      const shouldMakeLowerCase =
                Severity: Minor
                Found in src/platform/utilities/data/titleCase.js - About 35 mins 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