Showing 118 of 898 total issues
Function authenticate
has 27 lines of code (exceeds 25 allowed). Consider refactoring. Open
authenticate(jwt) {
return new Promise((resolve, reject) => {
const serverTokenEndpoint = this.serverTokenEndpoint;
fetch(serverTokenEndpoint, {
Function promise
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
let promise = new Promise((resolve, reject) => {
const url =
ENV.API_URL +
'/provider-prefixes?provider-id=' +
provider_id +
Function get_n_available
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
get_n_available() {
let promise = new Promise((resolve, reject) => {
const url =
ENV.API_URL + '/prefixes?page[number]=1&page[size]=0&state=unassigned';
const headers = { Accept: 'application/json' };
Function updateFunderReference
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
updateFunderReference(funder) {
switch (true) {
case funder === null:
this.fragment.set('funderIdentifierType', 'Other');
this.fragment.set('funderIdentifier', null);
Function validate
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
validate(value, options, model) {
let providerId = model.get('provider').get('symbol') + '.';
if (value === providerId) {
return true;
} else {
Function setDefaultPrefix
has 26 lines of code (exceeds 25 allowed). Consider refactoring. Open
setDefaultPrefix() {
let self = this;
this.store
.query('repository-prefix', {
'repository-id': this.repository.get('id'),
Function count
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
count: computed('data', 'summarize', function () {
if (this.data) {
if (this.summarize) {
return A(this.data).reduce(function (a, b) {
return a + b.count;
- 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 9 (exceeds 5 allowed). Consider refactoring. Open
validate(value, options) {
if (!value && options.allowBlank) {
return true;
} else if (!value) {
let message = "This field can't be blank.";
- 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 formatMetadata
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
export function formatMetadata([publicationYear], hash) {
let container = '';
if (hash.container && hash.container.title) {
container = ' via ' + hash.container.title;
} else if (hash.publisher && hash.publisher.name) {
- 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 count
has a Cognitive Complexity of 9 (exceeds 5 allowed). Consider refactoring. Open
count: computed('data', 'summarize', 'currentYear', function () {
if (this.data) {
if (this.summarize) {
return A(this.data).reduce(function (a, b) {
return a + b.count;
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function formatText([text], hash) {
text = entities.decode(text);
let allowedTags = [
'strong',
- 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 a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
didReceiveAttrs() {
this._super(...arguments);
if (this.licenseURL != null) {
let uri = new URI(this.licenseURL);
- 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 formatContact
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
export function formatContact([contact]) {
let name = null;
let email = null;
// use email as fallback if not givenName or familyName
- 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 deserialize
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring. Open
deserialize(serialized) {
if (serialized) {
return {
city: serialized.city ? serialized.city : '',
state: serialized.state
- 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 normalizeSingleResponse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
normalizeSingleResponse(store, primaryModelClass, payload, id, requestType) {
Function normalizeSingleResponse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
normalizeSingleResponse(store, primaryModelClass, payload, id, requestType) {
Function normalizeArrayResponse
has 5 arguments (exceeds 4 allowed). Consider refactoring. Open
normalizeArrayResponse(store, primaryModelClass, payload, id, requestType) {
Function formatNumbers
has a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
export function formatNumbers(counter) {
if (counter < 1e3) {
return counter;
}
if (counter >= 1e3 && counter < 1e6) {
- 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 a Cognitive Complexity of 7 (exceeds 5 allowed). Consider refactoring. Open
didReceiveAttrs() {
this._super(...arguments);
this.selectNameType(this.fragment.get('nameType'));
- 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
Avoid too many return
statements within this function. Open
return json;