Showing 118 of 898 total issues
Function validate
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
validate(value, options) {
const resourceTypeGeneralList = [
'Audiovisual',
'Book',
'BookChapter',
Function exports
has 41 lines of code (exceeds 25 allowed). Consider refactoring. Open
module.exports = (on, config) => {
let options = browserify.defaultOptions;
options.browserifyOptions.transform[1][1].babelrc = true;
options.typescript = require.resolve('typescript');
on('file:preprocessor', browserify(options));
Function didReceiveAttrs
has 40 lines of code (exceeds 25 allowed). Consider refactoring. Open
didReceiveAttrs() {
this._super(...arguments);
if (this.default) {
this.set('type', null);
Function didReceiveAttrs
has a Cognitive Complexity of 13 (exceeds 5 allowed). Consider refactoring. Open
didReceiveAttrs() {
this._super(...arguments);
if (this.model.get('landingPage').status == 200) {
let redirectText = 'resolved ';
- 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 providerFormErrors
has a Cognitive Complexity of 13 (exceeds 5 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
- 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 didReceiveAttrs
has 38 lines of code (exceeds 25 allowed). Consider refactoring. Open
didReceiveAttrs() {
this._super(...arguments);
let promise = new Promise((resolve, reject) => {
const url =
Function didReceiveAttrs
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
didReceiveAttrs() {
this._super(...arguments);
let promise = new Promise((resolve, reject) => {
const url = ENV.API_URL + '/providers/' + this.model.get('id') + '/stats';
Function didReceiveAttrs
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
didReceiveAttrs() {
this._super(...arguments);
let promise = new Promise((resolve, reject) => {
const url = ENV.API_URL + '/providers/' + this.model.get('id') + '/stats';
Function didReceiveAttrs
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
didReceiveAttrs() {
this._super(...arguments);
if (this.licenseURL != null) {
let uri = new URI(this.licenseURL);
Function selectStyle
has 37 lines of code (exceeds 25 allowed). Consider refactoring. Open
selectStyle(style) {
let self = this;
let url =
ENV.API_URL + '/dois/' + this.model.get('doi') + '?style=' + style;
let headers = { Accept: 'text/x-bibliography' };
Function submit
has 36 lines of code (exceeds 25 allowed). Consider refactoring. Open
submit() {
let self = this;
// iterate through all contacts and update roles
let m = this.model;
this.model.get('contacts').forEach(function (contact) {
Function joinNameParts
has a Cognitive Complexity of 12 (exceeds 5 allowed). Consider refactoring. Open
joinNameParts(options = {}) {
if (options.nameIdentifierScheme === 'ORCID') {
this.fragment.set('nameType', 'Personal');
this.set('nameType', 'Personal');
this.set('isReadonlyNameParts', true);
- 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 prefix_list
has 35 lines of code (exceeds 25 allowed). Consider refactoring. Open
prefix_list(n = 1, provider_id = null, query = '') {
let tot = n < 0 ? 0 : n;
let prefixes = [];
let promise = new Promise((resolve, reject) => {
Function load
has 35 lines of code (exceeds 25 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');
Function formatCreators
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
export default function formatCreators(creators, hash) {
let limit = creators.length;
if (hash.showOnly) {
limit = hash.showOnly;
Function updateNameIdentifier
has 34 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateNameIdentifier(value) {
if (
value.startsWith('https://orcid.org') ||
value.startsWith('http://orcid.org')
) {
Consider simplifying this complex logical expression. Open
if (
isPresent(this.get('model.publicationYear')) ||
isPresent(this.get('model.titles')) ||
isPresent(this.get('model.publisher')) ||
isPresent(this.get('model.creators')) ||
Function contentNegotiationUrl
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function contentNegotiationUrl([doi], hash) {
let mimeType = '';
switch (hash.format) {
case 'datacite':
mimeType = 'application/vnd.datacite.datacite+xml';
Function searchProvider
has 33 lines of code (exceeds 25 allowed). Consider refactoring. Open
searchProvider(query) {
let self = this;
if (this.currentUser.get('isAdmin')) {
this.store
.query('provider', {
Function model
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
model(params) {
let providerId = null;
let consortiumId = null;
let model = this.modelFor('providers/show');
if (model.memberType === 'consortium') {