datacite/bracco

View on GitHub

Showing 118 of 898 total issues

File doi-related-identifier.js has 264 lines of code (exceeds 250 allowed). Consider refactoring.
Open

/* eslint-disable no-useless-escape */
import Component from '@ember/component';
import { inject as service } from '@ember/service';
import { isURL, isISBN } from 'validator';
import { isBlank } from '@ember/utils';
Severity: Minor
Found in app/components/doi-related-identifier.js - About 2 hrs to fix

    Function selectRe3Data has 58 lines of code (exceeds 25 allowed). Consider refactoring.
    Open

        selectRe3Data(re3data) {
          if (re3data) {
            let self = this;
            this.store
              .findRecord('re3data', re3data.id)
    Severity: Major
    Found in app/controllers/providers/show/repositories/new.js - About 2 hrs to fix

      File doi.js has 258 lines of code (exceeds 250 allowed). Consider refactoring.
      Open

      import { computed } from '@ember/object';
      import { inject as service } from '@ember/service';
      import { Ability } from 'ember-can';
      
      export default Ability.extend({
      Severity: Minor
      Found in app/abilities/doi.js - About 2 hrs to fix

        `` has 21 functions (exceeds 20 allowed). Consider refactoring.
        Open

          actions: {
            // Purpose is to force validation on this field.
            toggleInput() {
              let estimate = this.model.get('doiEstimate');
        
        
        Severity: Minor
        Found in app/controllers/providers/new.js - About 2 hrs to fix

          Function submit has 52 lines of code (exceeds 25 allowed). Consider refactoring.
          Open

              submit(repository) {
                let self = this;
          
                // Remove all whitespace on domains.
                if (this.model.repository.get('domains')) {
          Severity: Major
          Found in app/controllers/providers/show/repositories/new.js - About 2 hrs to fix

            Function exports has 52 lines of code (exceeds 25 allowed). Consider refactoring.
            Open

            module.exports = function (defaults) {
              const pkg = require('./package.json');
            
              let app = new EmberApp(defaults, {
                minifyCSS: {
            Severity: Major
            Found in ember-cli-build.js - About 2 hrs to fix

              Function initUser has 52 lines of code (exceeds 25 allowed). Consider refactoring.
              Open

                initUser(payload) {
                  if (!isEmpty(payload) && !isEmpty(payload.uid)) {
                    this.set('uid', payload.uid);
                    this.set('name', payload.name);
                    this.set('email', payload.email);
              Severity: Major
              Found in app/services/current-user.js - About 2 hrs to fix

                Function submit has 51 lines of code (exceeds 25 allowed). Consider refactoring.
                Open

                    submit() {
                      let self = this;
                      let m = this.model;
                      // iterate through all contacts and update roles
                      this.model.get('contacts').forEach(function (contact) {
                Severity: Major
                Found in app/controllers/providers/show/edit.js - About 2 hrs to fix

                  Function validate has 49 lines of code (exceeds 25 allowed). Consider refactoring.
                  Open

                    validate(value, options, model) {
                      const ark = /^ark:\/[0-9]{5}\/\S+$/;
                      const lsid =
                        /^[uU][rR][nN]:[lL][sS][iI][dD]:(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%]):(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%]):(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%])[:]?(A-Za-z0-9][A-Za-z0-9()+,-.=@;$_!*'"%])?$/;
                      const purl = {
                  Severity: Minor
                  Found in app/validators/related-item-identifier-format.js - About 1 hr to fix

                    Function joinNameParts has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                    Open

                      joinNameParts(options = {}) {
                        if (options.nameIdentifierScheme === 'ORCID') {
                          this.fragment.set('nameType', 'Personal');
                          this.set('nameType', 'Personal');
                          this.set('isReadonlyNameParts', true);
                    Severity: Minor
                    Found in app/components/doi-related-item-contributor.js - About 1 hr to fix

                      Function showMetadata has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                      Open

                        showMetadata(metadata) {
                          if (metadata === 'summary') {
                            this.set('output', '');
                          } else {
                            this.set('output', '');
                      Severity: Minor
                      Found in app/components/doi-metadata.js - About 1 hr to fix

                        Function validate has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                        Open

                          validate(value, options, model) {
                            if (!value && options.allowBlank) {
                              return true;
                            } else {
                              let xml = this.b64EncodeUnicode(value);
                        Severity: Minor
                        Found in app/validators/metadata.js - About 1 hr to fix

                          Function joinNameParts has 48 lines of code (exceeds 25 allowed). Consider refactoring.
                          Open

                            joinNameParts(options = {}) {
                              if (options.nameIdentifierScheme === 'ORCID') {
                                this.fragment.set('nameType', 'Personal');
                                this.set('nameType', 'Personal');
                                this.set('isReadonlyNameParts', true);
                          Severity: Minor
                          Found in app/components/doi-related-item-creator.js - About 1 hr to fix

                            Function initUser has a Cognitive Complexity of 15 (exceeds 5 allowed). Consider refactoring.
                            Open

                              initUser(payload) {
                                if (!isEmpty(payload) && !isEmpty(payload.uid)) {
                                  this.set('uid', payload.uid);
                                  this.set('name', payload.name);
                                  this.set('email', payload.email);
                            Severity: Minor
                            Found in app/services/current-user.js - About 1 hr 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 searchRepository has 45 lines of code (exceeds 25 allowed). Consider refactoring.
                            Open

                              searchRepository(query) {
                                let self = this;
                                if (self.isDestroying || self.isDestroyed) {
                                  return;
                                }
                            Severity: Minor
                            Found in app/components/doi-transfer.js - About 1 hr to fix

                              Function providerFormErrors has 44 lines of code (exceeds 25 allowed). Consider refactoring.
                              Open

                              export function providerFormErrors([model]) {
                                let errorAttributes = model.validations.errors.mapBy('attribute');
                              
                                // check validation errors for embedded data model fragments
                                // but only if contacts exist
                              Severity: Minor
                              Found in app/helpers/provider-form-errors.js - About 1 hr to fix

                                Function didReceiveAttrs has a Cognitive Complexity of 14 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  didReceiveAttrs() {
                                    this._super(...arguments);
                                
                                    if (this.default) {
                                      this.set('type', null);
                                Severity: Minor
                                Found in app/components/application-header.js - About 1 hr 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 14 (exceeds 5 allowed). Consider refactoring.
                                Open

                                  validate(value) {
                                    if (!value) {
                                      return true;
                                    } else if (
                                      value.startsWith('https://orcid.org') ||
                                Severity: Minor
                                Found in app/validators/name-identifier.js - About 1 hr 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 submit has 43 lines of code (exceeds 25 allowed). Consider refactoring.
                                Open

                                    submit() {
                                      if (this.model['repository-prefix'].get('provider-prefix')) {
                                        let self = this;
                                
                                        this.model['repository-prefix'].get('provider-prefix').then((m) => {
                                Severity: Minor
                                Found in app/controllers/repositories/show/prefixes/new.js - About 1 hr to fix

                                  Function searchRepository has 42 lines of code (exceeds 25 allowed). Consider refactoring.
                                  Open

                                    searchRepository(query) {
                                      let self = this;
                                      if (this.currentUser.get('isAdmin')) {
                                        this.store
                                          .query('repository', { query, sort: 'name', 'page[size]': 100 })
                                  Severity: Minor
                                  Found in app/components/repository-dois-transfer.js - About 1 hr to fix
                                    Severity
                                    Category
                                    Status
                                    Source
                                    Language