datacite/bracco

View on GitHub

Showing 118 of 898 total issues

Avoid too many return statements within this function.
Open

    return `${+(counter / 1e12).toFixed(1)}T`;
Severity: Major
Found in app/helpers/format-numbers.js - About 30 mins to fix

    Avoid too many return statements within this function.
    Open

            return message;
    Severity: Major
    Found in app/validators/uuid-format.js - About 30 mins to fix

      Avoid too many return statements within this function.
      Open

            return true;
      Severity: Major
      Found in app/validators/name-identifier.js - About 30 mins to fix

        Avoid too many return statements within this function.
        Open

          return counter;
        Severity: Major
        Found in app/helpers/format-numbers.js - About 30 mins to fix

          Avoid too many return statements within this function.
          Open

                  return message;
          Severity: Major
          Found in app/validators/url-format.js - About 30 mins to fix

            Avoid too many return statements within this function.
            Open

                    return message;
            Severity: Major
            Found in app/validators/name-identifier.js - About 30 mins to fix

              Avoid too many return statements within this function.
              Open

                    return true;
              Severity: Major
              Found in app/validators/name-identifier.js - About 30 mins to fix

                Avoid too many return statements within this function.
                Open

                      return this.store
                        .findRecord('ror', id)
                        .then(function () {
                          return true;
                        })
                Severity: Major
                Found in app/validators/name-identifier.js - About 30 mins to fix

                  Avoid too many return statements within this function.
                  Open

                          return message;
                  Severity: Major
                  Found in app/validators/name-identifier.js - About 30 mins to fix

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

                      serialize(deserialized) {
                        if (deserialized) {
                          return {
                            city: deserialized.city,
                            state: deserialized.state ? deserialized.state.code : '',
                    Severity: Minor
                    Found in app/transforms/billing-information.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 orcid has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      orcid: computed('nameIdentifiers', function () {
                        if (this.nameIdentifiers) {
                          let id = A(this.nameIdentifiers).findBy('nameIdentifierScheme', 'ORCID');
                          if (
                            typeof id !== 'undefined' &&
                    Severity: Minor
                    Found in app/models/creator.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 load has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      load() {
                        if (this.get('session.data.authenticated.access_token')) {
                          // using authenticator:oauth2
                          let jwt = this.get('session.data.authenticated.access_token');
                    
                    
                    Severity: Minor
                    Found in app/services/current-user.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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      validate(value, options) {
                        if (!value && options.allowBlank) {
                          return true;
                        } else {
                          if (isEmail(value, options)) {
                    Severity: Minor
                    Found in app/validators/email-format.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 filterNull has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      filterNull(snapshot) {
                        if (isBlank(snapshot)) {
                          return {};
                        }
                    
                    
                    Severity: Minor
                    Found in app/serializers/related-item.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 setEvent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      setEvent(stateChange) {
                        if (stateChange[0] === 'draft' && stateChange[1] === 'registered') {
                          return 'register';
                        } else if (stateChange[0] === 'draft' && stateChange[1] === 'findable') {
                          return 'publish';
                    Severity: Minor
                    Found in app/controllers/dois/show/modify.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 isAbleTo has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                    export default function isAbleTo(self = null) {
                      let ret = false;
                    
                      if (self) {
                        if (self.get('currentUser.role_id') === 'consortium_admin') {
                    Severity: Minor
                    Found in app/utils/is-able-to.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 validate has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      validate(value, options) {
                        if (!value && options.allowBlank) {
                          return true;
                        } else {
                          if (isISSN(value, options)) {
                    Severity: Minor
                    Found in app/validators/issn-format.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 setEvent has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
                    Open

                      setEvent(stateChange) {
                        if (stateChange[0] === 'draft' && stateChange[1] === 'registered') {
                          return 'register';
                        } else if (stateChange[0] === 'draft' && stateChange[1] === 'findable') {
                          return 'publish';
                    Severity: Minor
                    Found in app/controllers/dois/show/edit.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