ilios/frontend

View on GitHub

Showing 92 of 92 total issues

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

  getBrowserLogo(id) {
    if (id === 'ios_saf') {
      id = 'safari-ios';
    }
    if (id === 'samsung') {
Severity: Minor
Found in packages/frontend/lib/ilios-error/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 getBrowserLogo has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  getBrowserLogo(id) {
    if (id === 'ios_saf') {
      id = 'safari-ios';
    }
    if (id === 'samsung') {
Severity: Minor
Found in packages/lti-course-manager/lib/ilios-error/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 get has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  get: function (obj, prop) {
    if ('type' === prop) {
      if (obj.isBlanked) {
        return 'unknown';
      }

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

  async makeSmallGroupOfferingObjects(offerings) {
    const smallGroupMode = this.args.smallGroupMode;
    if (!smallGroupMode) {
      return offerings;
    }
Severity: Minor
Found in packages/ilios-common/addon/components/offering-form.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 moveFocus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  @action
  moveFocus({ key, target }) {
    switch (key) {
      case 'ArrowDown':
        if (target.nextElementSibling) {
Severity: Minor
Found in packages/ilios-common/addon/components/choose-material-type.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 getDataObjects has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  async getDataObjects(sessions) {
    const sessionsWithMinutes = sessions.map(async (session) => {
      const hours = await session.getTotalSumDuration();
      return {
        session,

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

  get compiledCalendarEvents() {
    if (this.args.selectedView === 'day') {
      return this.args.calendarEvents;
    } else {
      const hashedEvents = {};
Severity: Minor
Found in packages/ilios-common/addon/components/ilios-calendar.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 requiredPublicationIssues has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  get requiredPublicationIssues() {
    const issues = [];
    if (this.isIndependentLearning) {
      if (!this._ilmSession?.dueDate) {
        issues.push('dueDate');
Severity: Minor
Found in packages/ilios-common/addon/models/session.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 moveFocus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  @action
  moveFocus(event) {
    const { key, target } = event;
    switch (key) {
      case 'ArrowDown':
Severity: Minor
Found in packages/frontend/app/components/locale-chooser.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 moveFocus has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring.
Open

  @action
  moveFocus({ key, target }) {
    switch (key) {
      case 'ArrowDown':
        if (target.nextElementSibling) {
Severity: Minor
Found in packages/ilios-common/addon/components/session/publication-menu.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

Avoid too many return statements within this function.
Open

    return 0;
Severity: Major
Found in packages/ilios-common/addon/components/week-glance-event.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

          return true;
    Severity: Major
    Found in packages/ilios-common/addon/models/user.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

        return 0;
      Severity: Major
      Found in packages/ilios-common/addon/helpers/sort-by.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return 0;
        Severity: Major
        Found in packages/ilios-common/addon/utils/sortable-by-position.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                return true;
          Severity: Major
          Found in packages/ilios-common/addon/models/user.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                  return spaceship(v.getTime(), w.getTime());
            Severity: Major
            Found in packages/ilios-common/addon/utils/array-helpers.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                  return Array.from(Object.values(maybeArray));
              Severity: Major
              Found in packages/ilios-common/addon/utils/as-array.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return spaceship(v.localeCompare(w), 0);
                Severity: Major
                Found in packages/ilios-common/addon/utils/array-helpers.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                            return 1;
                  Severity: Major
                  Found in packages/ilios-common/addon/services/timezone.js - About 30 mins to fix

                    Avoid too many return statements within this function.
                    Open

                        return 1;
                    Severity: Major
                    Found in packages/ilios-common/addon/helpers/sort-by.js - About 30 mins to fix
                      Severity
                      Category
                      Status
                      Source
                      Language