ilios/frontend

View on GitHub

Showing 92 of 92 total issues

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 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 [];
      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 false;
        Severity: Major
        Found in packages/ilios-common/addon/components/session-overview.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

              return collator.compare(bValue, aValue);
          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/services/timezone.js - About 30 mins to fix

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

                function errorCaptureConfig(config) {
                  const errorCaptureName = 'error-capture-enabled';
                  const errorEnvironmentName = 'error-capture-environment';
                
                  const { modulePrefix, serverVariables } = config;
                Severity: Minor
                Found in packages/frontend/app/sentry.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 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 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 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