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';
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)
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({
`` 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');
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')) {
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: {
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);
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) {
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 = {
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);
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', '');
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);
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);
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);
- Read upRead up
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;
}
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
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);
- Read upRead up
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') ||
- Read upRead up
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) => {
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 })