ilios/frontend

View on GitHub

Showing 90 of 90 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 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 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/course/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

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

  async getGraphQLFilters(prepositionalObject, prepositionalObjectTableRowId, school) {
    let rhett = [];
    if (school) {
      rhett.push(`schools: [${school.id}]`);
    }
Severity: Minor
Found in packages/frontend/app/components/reports/subject/learning-material.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 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

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

Avoid too many return statements within this function.
Open

    return [];
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 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 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 collator.compare(aValue, bValue);
        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/components/single-event.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/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

                Avoid too many return statements within this function.
                Open

                    return Array.from(maybeArray.values());
                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 content.toArray();
                  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 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 'file';
                      Severity: Major
                      Found in packages/ilios-common/addon/components/lm-type-icon.js - About 30 mins to fix
                        Severity
                        Category
                        Status
                        Source
                        Language