department-of-veterans-affairs/vets-website

View on GitHub

Showing 3,724 of 12,675 total issues

Function startApp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function startApp({
  routes,
  createRoutesWithStore,
  component,
  reducer,
Severity: Minor
Found in src/platform/startup/index.js - About 25 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 VaSelectField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function VaSelectField(props) {
  let addDefaultEntry = false;
  const mappedProps = vaSelectFieldMapping(props);
  const enumOptions =
    (Array.isArray(props.childrenProps.schema.enum) &&
Severity: Minor
Found in src/platform/forms-system/src/js/web-component-fields/VaSelectField.jsx - About 25 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 UNSAFE_componentWillReceiveProps has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  UNSAFE_componentWillReceiveProps(newProps) {
    const loginAttemptCompleted =
      this.props.showLoginModal === true &&
      newProps.showLoginModal === false &&
      this.loginAttemptInProgress;
Severity: Minor
Found in src/platform/forms/components/SignInLink.jsx - About 25 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 vaTextareaFieldMapping has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

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

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

const currentOrPastDateRangeUI = (fromOptions, toOptions, errorMessage) => {
  let fromLabel = 'From date';
  let toLabel = 'To date';
  let fromCustomOptions = {};
  let toCustomOptions = {};
Severity: Minor
Found in src/platform/forms-system/src/js/web-component-patterns/datePatterns.jsx - About 25 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 profileContactInfo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

const profileContactInfo = ({
  content = getContent('application'),

  contactPath = CONTACT_INFO_PATH,
  addressSchema,
Severity: Minor
Found in src/platform/forms-system/src/js/definitions/profileContactInfo.js - About 25 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 clone has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function clone(object) {
  /* eslint-disable no-prototype-builtins */
  if (typeof object === 'object') {
    if (Array.isArray(object)) {
      return object.slice();
Severity: Minor
Found in src/platform/utilities/data/clone.js - About 25 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 startReactApp has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function startReactApp(
  component,
  root = document.getElementById('react-root'),
) {
  // Detect if this is a child frame. If yes, initialize the react devtools hook to work around
Severity: Minor
Found in src/platform/startup/react.js - About 25 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 StringField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function StringField(props) {
  const { registry, schema, uiSchema, formData } = props;
  const uiOptions = getUiOptions(uiSchema);
  const labels = uiOptions.labels || {};
  const enumOptions = Array.isArray(schema.enum) && optionsList(schema);
Severity: Minor
Found in src/platform/forms-system/src/js/review/StringField.jsx - About 25 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 SelectWidget has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function SelectWidget({
  schema,
  id,
  options,
  value,
Severity: Minor
Found in src/platform/forms-system/src/js/widgets/SelectWidget.jsx - About 25 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 countOverlapWords has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function countOverlapWords(userInput, dropdownTerm, splitreg = REGEX_SPLIT) {
  const splitInput = stripCommonWords(userInput).split(splitreg);
  const splitOption = stripCommonWords(dropdownTerm).split(splitreg);
  const tempOverlapList = [];
  for (let i = 0; i < splitInput.length; i += 1) {

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

const schema = optionalFields => {
  const s = {
    type: 'object',
    properties: {
      bankAccount: {
Severity: Minor
Found in src/platform/forms-system/src/js/definitions/directDeposit.jsx - About 25 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 maxItemsHint has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const maxItemsHint = ({
  arrayData,
  nounSingular,
  nounPlural,
  maxItems,
Severity: Minor
Found in src/platform/forms-system/src/js/patterns/array-builder/helpers.js - About 25 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 constructor has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

  constructor(props) {
    super(props);
    // In contrast to the normal array field, we don’t want to add an empty item
    // and always show at least one item on the review page
    const arrayData = (Array.isArray(props.arrayData) && props.arrayData) || [];
Severity: Minor
Found in src/platform/forms-system/src/js/review/ArrayField.jsx - About 25 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 RadioWidget has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function RadioWidget({
  options,
  value,
  disabled,
  onChange,
Severity: Minor
Found in src/platform/forms-system/src/js/widgets/RadioWidget.jsx - About 25 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 formatDayMonth has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function formatDayMonth(val) {
  if (val) {
    const dayOrMonth = val.toString();
    if (Number(dayOrMonth) && dayOrMonth.length === 1) {
      return `0${val}`;
Severity: Minor
Found in src/platform/forms-system/src/js/helpers.js - About 25 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 determineYesNoField has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

function determineYesNoField(uiSchema) {
  let yesNoKey;
  if (uiSchema) {
    for (const key of Object.keys(uiSchema)) {
      if (
Severity: Minor
Found in src/platform/forms-system/src/js/patterns/array-builder/arrayBuilder.jsx - About 25 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 numberToWords has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export default function numberToWords(value) {
  const string = value?.toString();
  const number = parseFloat(string);

  if (
Severity: Minor
Found in src/platform/forms-system/src/js/utilities/data/numberToWords.js - About 25 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 evaluateOneOfChoices has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
Open

export const evaluateOneOfChoices = (oneOfChoices, formResponses) => {
  for (const choice of Object.keys(oneOfChoices)) {
    if (
      Array.isArray(oneOfChoices[choice]) &&
      validateMultiCheckboxResponses(
Severity: Minor
Found in src/applications/pact-act/utilities/display-logic-questions.js - About 25 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 createExternalApplicationUrl has a Cognitive Complexity of 6 (exceeds 5 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 25 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