Showing 118 of 898 total issues
Function model
has 32 lines of code (exceeds 25 allowed). Consider refactoring. Open
model() {
let self = this;
let id = this.modelFor('dois/show').get('id');
return this.store
.findRecord('doi', id, {
Function joinNameParts
has a Cognitive Complexity of 11 (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 model
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
model() {
if (this.currentUser.get('client_id')) {
return this.store
.findRecord('repository', this.currentUser.get('uid'))
.then(function (repository) {
Function afterModel
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
afterModel() {
if (this.get('currentUser.role_id') === 'staff_admin') {
var self = this;
this.prefixes.available().then(
Function searchPrefix
has 31 lines of code (exceeds 25 allowed). Consider refactoring. Open
searchPrefix(query) {
let self = this;
let prefixes = [];
this.prefixes_service
Function promise
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
let promise = new Promise((resolve, reject) => {
this.store
.query('provider-prefix', {
query,
'provider-id': provider_id,
Function sendLink
has 30 lines of code (exceeds 25 allowed). Consider refactoring. Open
sendLink() {
this.set('requestSent', false);
let { identification } = this;
let self = this;
let url = ENV.API_URL + '/reset';
Function get_n_available_pp
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
get_n_available_pp(provider_id = null) {
let promise = new Promise((resolve, reject) => {
const url =
ENV.API_URL +
'/provider-prefixes?provider-id=' +
Function didReceiveAttrs
has 29 lines of code (exceeds 25 allowed). Consider refactoring. Open
didReceiveAttrs() {
this._super(...arguments);
this.set('query', this.model.get('query.query'));
this.set('sort', this.model.get('query.sort'));
Function model
has 29 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') {
Function model
has 29 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') {
Function model
has 28 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') {
Function validate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
validate(value, options, model) {
if (!value && options.allowBlank) {
return true;
} else {
return this.store
Function model
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
model() {
let self = this;
let url = ENV.FABRICA_URL + '/authorize';
fetch(url)
.then(function (response) {
Function validate
has 28 lines of code (exceeds 25 allowed). Consider refactoring. Open
validate(value, options) {
if (!value && options.allowBlank) {
return true;
} else if (!value) {
let message = "This field can't be blank.";
Function formattedBillingInformation
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
function () {
if (this.billingInformation) {
return addressFormatter.format(
{
road: this.billingInformation.address,
- 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 updateNameIdentifier
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
updateNameIdentifier(value) {
if (
value.startsWith('https://orcid.org') ||
value.startsWith('http://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 validate
has a Cognitive Complexity of 10 (exceeds 5 allowed). Consider refactoring. Open
validate(value, options) {
if (!value && options.allowBlank) {
return true;
} else if (options.version) {
if (isUUID(value, options.version)) {
- 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 formatText
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
export function formatText([text], hash) {
text = entities.decode(text);
let allowedTags = [
'strong',
Function validate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
validate(value, options, model) {
let providerId = model.get('provider.id');
let query = `email:${value} !uid:${model.get('id')}`;
// email should be unique per provider,