ilios/frontend

View on GitHub

Showing 90 of 90 total issues

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 -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 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 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 maybeArray.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/components/single-event.js - About 30 mins to fix

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

                get icsFeedUrl() {
                  if (this.icsFeedKey) {
                    let host = this.host;
                    if (!host) {
                      host = window.location.protocol + '//' + window.location.hostname;
              Severity: Minor
              Found in packages/frontend/app/components/user-profile-ics.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 getUserFullName has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                getUserFullName(user) {
                  if (user.displayName) {
                    return user.displayName;
                  }
              
              
              Severity: Minor
              Found in packages/ilios-common/addon/services/search.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 allInstructors has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

                get allInstructors() {
                  if (
                    !this._offeringInstructorsData?.isResolved ||
                    !this._offeringInstructorGroupsInstructors?.isResolved ||
                    (this.isIndependentLearning && !this._ilmInstructorsData?.isResolved) ||
              Severity: Minor
              Found in packages/ilios-common/addon/models/session.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 sortBy has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
              Open

              export function sortBy(arr, sortKeys) {
                if (arr !== null && typeof arr === 'object') {
                  if ('slice' in arr) {
                    arr = arr.slice();
                  }
              Severity: Minor
              Found in packages/ilios-common/addon/utils/array-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

              Severity
              Category
              Status
              Source
              Language